-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic support for callout blocks #29
Commits on May 10, 2022
-
Add basic support for callout blocks
Currently, it just prints the content of the block but ignores the emoji and color. Closes #26
Configuration menu - View commit details
-
Copy full SHA for 9438df5 - Browse repository at this point
Copy the full SHA 9438df5View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa8027a - Browse repository at this point
Copy the full SHA aa8027aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a24b47 - Browse repository at this point
Copy the full SHA 9a24b47View commit details
Commits on May 15, 2022
-
Refactor block class constructor
Previously, the Block class constructor would iterate through all of the top-level keys of the Notion block objects, dynamically adding them all as attributes the the Block instance. Then, it would loop through all of the block-specific keys and also add them as attributes. Although this was working, in some cases the block-specific keys would over-ride the top-level keys (e.g., the "type" key in particular was being shadowed in a few cases). Dynamically adding the keys makes it more difficult to read and debug the code, since you don't know what keys are going to be set until run-time. This makes writing plugins more difficult. Also, errors due to changes in the notion API (or even issues with poorly constructed mock test data) don't appear until the expected keys are used in the `to_pandoc` calls, rather than during the constructors. This commit explicilty sets all of the top-level keys. It also moves the "type" key into the "notion_type" attribute, which avoids shadowing issues if the block-specific object has a "type" key. The "id" key was also moved to "notion_id". After making this change, the unit tests were failing since now some of the top-level keys that previously weren't being set in the unit tests were now missing. To ensure that these keys are always present, the tests were updated to use a set of mock objects that ensure the keys always exist. Furthermore, the tests related to the rich_text objects were split out into their own file. Duplication in the test was also removed through the addition of the `process_block` and `process_parent_block` functions. There is a second refactor which I believe should occur, which is to move the block-specific attributes into each block's constructors. This will make the block-specific attribute construction more explicit as well, which is good for all of the reasons stated above. A bit of work in this direction was made, but more work is needed.
Configuration menu - View commit details
-
Copy full SHA for 348ae2f - Browse repository at this point
Copy the full SHA 348ae2fView commit details -
Rename block classes so they all end with "Block"
Although it makes a few of the names kind of long, the consistency seems worthwhile.
Configuration menu - View commit details
-
Copy full SHA for f253a13 - Browse repository at this point
Copy the full SHA f253a13View commit details -
Delete notion complex list file; fix typos
The json file isn't needed or worth maintaining now that we have end to end tests.
Configuration menu - View commit details
-
Copy full SHA for 5ace528 - Browse repository at this point
Copy the full SHA 5ace528View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d0f7e0 - Browse repository at this point
Copy the full SHA 6d0f7e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6da5016 - Browse repository at this point
Copy the full SHA 6da5016View commit details
Commits on May 16, 2022
-
Make block-specific attributes explicit; remove the placeholder block…
… classes See the deleted TODO comments in the commit for the motiviation for these refactors.
Configuration menu - View commit details
-
Copy full SHA for 7778902 - Browse repository at this point
Copy the full SHA 7778902View commit details -
Configuration menu - View commit details
-
Copy full SHA for a6885e8 - Browse repository at this point
Copy the full SHA a6885e8View commit details
Commits on May 17, 2022
-
- Remove a leftover print statement - Fix argument bug - Fix issue with block retrieval that (I think) was due to the notion API changing out from under us.
Configuration menu - View commit details
-
Copy full SHA for 7fd90a5 - Browse repository at this point
Copy the full SHA 7fd90a5View commit details