-
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 all blocks to the readme table #63
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ n2y.egg-info/ | |
build/ | ||
dist/ | ||
.vscode | ||
venv | ||
requirements.txt |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -99,27 +99,36 @@ Here are the default block classes that can be extended: | |||||
|
||||||
| Class Name | Noteworthy Behavior | | ||||||
| --- | --- | | ||||||
| BookmarkBlock | | | ||||||
| BookmarkBlock | Converts visual bookmark into plain text link in markdown, using the caption as the link text. | | ||||||
| BreadcrumbBlock | Ignore | | ||||||
| BulletedListItemBlock | | | ||||||
| CalloutBlock | The content of the callout block is extracted, but the emoji and background color are ignored. | | ||||||
| ChildPageBlock | | | ||||||
| FencedCodeBlock | | | ||||||
| ChildDatabaseBlock | Converts database to markdown in different file in directory and writes a relative link to the markdown| | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The difficulty with exporting the child database to markdown is that there's no way to represent a database as a single markdown file. Depending on the selected output format, a database is either a single YAML file or many markdown files. For now, I propose we just ignore child databases. |
||||||
| ChildPageBlock | Converts Child Page to markdown. | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depending on the selected output format Command-line argument, we may or many not be exporting the child pages into markdown. In fact, currently, we don't ever export child page objects. In the future, we will have a recursive export format option that will recursively go through a page and export everything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, I propose we just ignore child pages. In the future, I think the solution you have outlined is a good one. |
||||||
| ColumnBlock | | | ||||||
| ColumnListBlock | Converts into a table where each column is such. | | ||||||
| DividerBlock | | | ||||||
| EmbedBlock | Ignore | | ||||||
| EquationBlock | Converted to "display math" using LaTeX; see the [pandoc](https://pandoc.org/MANUAL.html#math) documentation. | | ||||||
| FencedCodeBlock | | | ||||||
| FileBlock | Acts the same way as the ImageBlock, except that in the documents it only ever shows the URL. | | ||||||
| HeadingOneBlock | | | ||||||
| HeadingTwoBlock | | | ||||||
| HeadingThreeBlock | | | ||||||
| ImageBlock | It uses the URL for external images, but downloads uploaded images to the `MEDIA_ROOT` and replaces the path with a relative url based off of `MEDIA_URL`. The "caption" is used for the alt text. | | ||||||
| FileBlock | Acts the same way as the ImageBlock, except that in the documents it only ever shows the URL. | | ||||||
| LinkToPageBlock | Transcribes the block into a plain text link | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||||||
| NumberedListItemBlock | | | ||||||
| ParagraphBlock | | | ||||||
| PdfBlock | Acts the same way ass the Image block | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| QuoteBlock | | | ||||||
| EquationBlock | Converted to "display math" using LaTeX; see the [pandoc](https://pandoc.org/MANUAL.html#math) documentation. | | ||||||
| TableBlock | | | ||||||
| RowBlock | | | ||||||
| SyncedBlock | Transcribe the contents of the synced block at the time it was constructed | | ||||||
| TableBlock | | | ||||||
| TableOfContentsBlock | transcribes the contenets of the Table of contents block into page links | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can ignore the table of contents blocks for now. |
||||||
| TemplateBlock | Ignore | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||||||
| ToDoItemBlock | | | ||||||
| ToggleBlock | Convert the toggles into a bulleted list. | | ||||||
| ColumnBlock | | | ||||||
| ColumnListBlock | Columns are flattened and displayed sequentially. | | ||||||
| ToggleBlock | Convert toggles into a details and summary tag. | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the current default functionality for the ToggleBlock is appropriate. Users can use a plugin if they want to produced details and summary tags. Keep in mind we are often exporting to non-HTML formats, like PDF or Word documents. |
||||||
| VideoBlock | Acts the same way ass the Image block | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
|
||||||
Most of the Notion blocks can generate their pandoc AST from _only_ their own data. The one exception is the list item blocks; pandoc, unlike Notion, has an encompassing node in the AST for the entire list. The `ListItemBlock.list_to_pandoc` class method is responsible for generating this top-level node. | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.