Skip to content

Commit

Permalink
fix task lists
Browse files Browse the repository at this point in the history
  • Loading branch information
marph91 committed Oct 5, 2024
1 parent 227f6f2 commit e39b513
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 22 deletions.
7 changes: 1 addition & 6 deletions docs/formats/synology_note_station.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,4 @@ This page describes how to convert notes from Synology Note Station to Markdown.

## Known Limitations

If you have any of the following issuea and can provide an example file in `.nsx` format, please [open an issue](https://github.com/marph91/jimmy/issues/new/choose) or send me an email.

- Some tables aren't converted. See [here](https://github.com/marph91/jimmy/issues/6#issuecomment-2184924515).
- Some resources aren't converted. See [here](https://github.com/marph91/jimmy/issues/6#issuecomment-2184049255).
- The filetype of resources won't be correct until <https://github.com/laurent22/joplin/issues/10653> is added. Then still non-binary resources (text files like Markdown, svg, ...) will be detected incorrectly. The mime type can't be set correctly by API either (see [Joplin thread](https://discourse.joplinapp.org/t/how-does-joplin-determine-the-mime-type-of-a-resource/38726/5)).
- Inline charts are not converted.
Inline charts are not converted.
4 changes: 0 additions & 4 deletions docs/formats/zoho_notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ This page describes how to convert notes from Zoho Notebook to Markdown.
2. [Install jimmy](../index.md#installation)
3. Convert to Markdown. Example: `jimmy-cli-linux Notebook_14Apr2024_1300_html.zip --format zoho_notebook`
4. [Import to your app](../import_instructions.md)

## Known Limitations

- Checklists are converted to plain lists. This might change with a newer pandoc version.
10 changes: 0 additions & 10 deletions src/formats/zoho_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ def clean_tables(soup):
text_only = td.text
td.clear()
td.append(text_only)
# tables seem to be headerless always
# # make first row to header
# if row_index == 0:
# td.name = "th"
# # remove "tbody"
# body = table.find("tbody")
# body.unwrap()


def clean_task_lists(soup):
Expand Down Expand Up @@ -136,9 +129,6 @@ def convert_note(self, file_: Path):
# )

# convert the note body to Markdown
# TODO:
# - checklists are note working, even with "+task_lists"
# - tables are not working
if soup.body is not None:
clean_tables(soup)
clean_task_lists(soup)
Expand Down
8 changes: 7 additions & 1 deletion src/markdown_lib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,13 @@ def get_inline_tags(text: str, start_characters: list[str]) -> list[str]:
# markdown output formats:
# https://pandoc.org/chunkedhtml-demo/8.22-markdown-variants.html
# Don't use "commonmark_x". There would be too many noise.
PANDOC_OUTPUT_FORMAT = "markdown_strict+pipe_tables+backtick_code_blocks-raw_html"
PANDOC_OUTPUT_FORMAT = (
"markdown_strict"
"+pipe_tables"
"+backtick_code_blocks"
"+task_lists"
"-raw_html"
)


def markup_to_markdown(text: str, format_: str = "html") -> str:
Expand Down
2 changes: 1 addition & 1 deletion test/data
Submodule data updated 52 files
+1 −1 reference_data/attachment_folder/global_resource_folder____images/My Notebook/Another note.md
+2 −2 ...older/global_resource_folder____images/My Notebook/Nested Notebook/note in other notebook with same name.md
+1 −1 reference_data/attachment_folder/global_resource_folder____images/My Notebook/photo card (image only).md
+1 −1 reference_data/attachment_folder/global_resource_folder_ima_ges/My Notebook/Another note.md
+2 −2 ..._folder/global_resource_folder_ima_ges/My Notebook/Nested Notebook/note in other notebook with same name.md
+1 −1 reference_data/attachment_folder/global_resource_folder_ima_ges/My Notebook/photo card (image only).md
+ reference_data/attachment_folder/global_resource_folder_ima_ges/ima_ges/82eba373e2054df8adb94274c3add306.png
+ reference_data/attachment_folder/global_resource_folder_ima_ges/ima_ges/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/attachment_folder/global_resource_folder_images/My Notebook/Another note.md
+2 −2 ...t_folder/global_resource_folder_images/My Notebook/Nested Notebook/note in other notebook with same name.md
+1 −1 reference_data/attachment_folder/global_resource_folder_images/My Notebook/photo card (image only).md
+ reference_data/attachment_folder/global_resource_folder_images/images/82eba373e2054df8adb94274c3add306.png
+ reference_data/attachment_folder/global_resource_folder_images/images/f366f8bedd8e42e68c32e88bfdc6ca31.png
+ reference_data/attachment_folder/images/82eba373e2054df8adb94274c3add306.png
+ reference_data/attachment_folder/images/f366f8bedd8e42e68c32e88bfdc6ca31.png
+ reference_data/attachment_folder/local_resource_folder__/My Notebook/82eba373e2054df8adb94274c3add306.png
+1 −1 reference_data/attachment_folder/local_resource_folder__/My Notebook/Another note.md
+2 −2 ...achment_folder/local_resource_folder__/My Notebook/Nested Notebook/note in other notebook with same name.md
+ reference_data/attachment_folder/local_resource_folder__/My Notebook/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/attachment_folder/local_resource_folder__/My Notebook/photo card (image only).md
+1 −1 reference_data/attachment_folder/local_resource_folder_ima_ges/My Notebook/Another note.md
+2 −2 ...t_folder/local_resource_folder_ima_ges/My Notebook/Nested Notebook/note in other notebook with same name.md
+ ...ta/attachment_folder/local_resource_folder_ima_ges/My Notebook/ima_ges/82eba373e2054df8adb94274c3add306.png
+ ...ta/attachment_folder/local_resource_folder_ima_ges/My Notebook/ima_ges/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/attachment_folder/local_resource_folder_ima_ges/My Notebook/photo card (image only).md
+1 −1 reference_data/attachment_folder/local_resource_folder_images/My Notebook/Another note.md
+2 −2 ...nt_folder/local_resource_folder_images/My Notebook/Nested Notebook/note in other notebook with same name.md
+ ...data/attachment_folder/local_resource_folder_images/My Notebook/images/82eba373e2054df8adb94274c3add306.png
+ ...data/attachment_folder/local_resource_folder_images/My Notebook/images/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/attachment_folder/local_resource_folder_images/My Notebook/photo card (image only).md
+ reference_data/frontmatter/all/My Notebook/82eba373e2054df8adb94274c3add306.png
+1 −1 reference_data/frontmatter/all/My Notebook/Another note.md
+3 −3 reference_data/frontmatter/all/My Notebook/Nested Notebook/note in other notebook with same name.md
+ reference_data/frontmatter/all/My Notebook/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/frontmatter/all/My Notebook/photo card (image only).md
+ reference_data/frontmatter/joplin/My Notebook/82eba373e2054df8adb94274c3add306.png
+1 −1 reference_data/frontmatter/joplin/My Notebook/Another note.md
+3 −3 reference_data/frontmatter/joplin/My Notebook/Nested Notebook/note in other notebook with same name.md
+ reference_data/frontmatter/joplin/My Notebook/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/frontmatter/joplin/My Notebook/photo card (image only).md
+ reference_data/frontmatter/obsidian/My Notebook/82eba373e2054df8adb94274c3add306.png
+1 −1 reference_data/frontmatter/obsidian/My Notebook/Another note.md
+2 −2 reference_data/frontmatter/obsidian/My Notebook/Nested Notebook/note in other notebook with same name.md
+ reference_data/frontmatter/obsidian/My Notebook/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/frontmatter/obsidian/My Notebook/photo card (image only).md
+ reference_data/joplin/test_1/My Notebook/82eba373e2054df8adb94274c3add306.png
+1 −1 reference_data/joplin/test_1/My Notebook/Another note.md
+2 −2 reference_data/joplin/test_1/My Notebook/Nested Notebook/note in other notebook with same name.md
+ reference_data/joplin/test_1/My Notebook/f366f8bedd8e42e68c32e88bfdc6ca31.png
+1 −1 reference_data/joplin/test_1/My Notebook/photo card (image only).md
+2 −2 reference_data/zoho_notebook/test_1/My Notebook/note in other notebook with same name.md
+ test_data/joplin/test_1/29_04_2024.jex

0 comments on commit e39b513

Please sign in to comment.