Skip to content

Conversation

@ITAYC0HEN
Copy link
Contributor

@ITAYC0HEN ITAYC0HEN commented Jan 24, 2021

The following Pull Rrquest adds support for the getBacklinksForBlock API which allows us to list the backlinks of a block of type "page".

Example:

peter_singer_block = client.get_block(BLOCK_ID)
peter_singer_block.get_backlinks()

## Output:

[<TextBlock (id='834ca4dd-6b52-4885-80f5-cabb9d889fba', title='What about ‣ then?')>,
 <TextBlock (id='ce1566a8-2e6c-4254-9580-c2c62c378d00', title='Similarly to the claim raised by ‣ on his book...')>]

@jamalex jamalex merged commit 87ee46a into jamalex:master Jan 24, 2021
@jamalex
Copy link
Owner

jamalex commented Jan 25, 2021

Thank you for the contribution, fellow Ⓥ Activist! I can see this being particularly important for Peter Singer documents, given how frequently he is cited. :)

I added some fixes based on an issue I found -- it seems when a child page links to its parent, the key is called parent_block_id instead of block_id. I also added this to the smoketest: 0f54c9c

@ITAYC0HEN ITAYC0HEN deleted the feature/getBacklinksForBlock branch January 25, 2021 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants