Skip to content
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

Merged
merged 3 commits into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ n2y.egg-info/
build/
dist/
.vscode
venv
requirements.txt
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| BreadcrumbBlock | Ignore |
| BreadcrumbBlock | These blocks are ignored |

| 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|
Copy link
Contributor

Choose a reason for hiding this comment

The 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

| NumberedListItemBlock | |
| ParagraphBlock | |
| PdfBlock | Acts the same way ass the Image block |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| PdfBlock | Acts the same way ass the Image block |
| PdfBlock | Acts the same way as the Image block |

| 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 |
Copy link
Contributor

Choose a reason for hiding this comment

The 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 |
Copy link
Contributor

Choose a reason for hiding this comment

The 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. |
Copy link
Contributor

Choose a reason for hiding this comment

The 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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| VideoBlock | Acts the same way ass the Image block |
| VideoBlock | Acts the same way as the Image block |



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.
Expand Down