Skip to content

Commit

Permalink
feat(wiki2pandoc): support markdown syntax
Browse files Browse the repository at this point in the history
Add default pandoc from markdown settings for all wiki2pandoc module.

Closes #2
  • Loading branch information
jfishe committed Apr 18, 2024
1 parent 025d8ed commit 4e99f10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/panvimwiki/wiki2pandoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from panvimwiki.convert import convert
from panvimwiki.vimwiki_week import concatenate_diary

FORMAT = "markdown+wikilinks_title_after_pipe-task_lists"


@bridged
def vimwiki_task_link() -> None:
Expand All @@ -33,7 +35,7 @@ def vimwiki_task_link() -> None:
convert(
inputfile=str(path),
outputfile=str(path),
format="markdown+wikilinks_title_after_pipe-task_lists-citations",
format=FORMAT + "-citations",
to="gfm",
prefilters=None,
filters=None,
Expand Down Expand Up @@ -61,7 +63,7 @@ def expand_citeproc() -> None:
convert(
inputfile=str(path),
outputfile=str(path),
format="markdown+wikilinks_title_after_pipe-task_lists",
format=FORMAT,
to="gfm+wikilinks_title_after_pipe",
prefilters=None,
filters=None,
Expand Down Expand Up @@ -166,9 +168,15 @@ def wiki2pandoc(
outputfile = path_html.parent / Path(to) / outputfile.relative_to(wiki_path)
outputfile.parent.mkdir(parents=True, exist_ok=True)

if vim.eval("vimwiki#vars#get_wikilocal('syntax')") == "markdown":
local_format: str = FORMAT + "-citations"
else:
local_format = "vimwiki"

convert(
inputfile=str(inputfile),
outputfile=str(outputfile),
format=local_format,
to=to,
extra_args=tuple(extra_args),
)
Expand Down

0 comments on commit 4e99f10

Please sign in to comment.