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

Vimwiki reader #3705

Merged
merged 104 commits into from
Jun 19, 2017
Merged

Vimwiki reader #3705

merged 104 commits into from
Jun 19, 2017

Conversation

ycpei
Copy link
Contributor

@ycpei ycpei commented May 28, 2017

See #863.

This is a preliminary version.

Descriptions and comments about progress etc. are in the issue thread.

@ycpei
Copy link
Contributor Author

ycpei commented Jun 16, 2017

I think this may be ready to merge now. Let me know if there are any bugs or other problems.

Edit: Sigh. Just found another bug. Will fix it soon.

Edit 2: the bug is fixed. Ready to merge again.

@jgm
Copy link
Owner

jgm commented Jun 19, 2017

test/vimwiki-reader.html seems not to be used; can it be removed?

@jgm
Copy link
Owner

jgm commented Jun 19, 2017

Can you make sure that the code is wrapped to within 80 columns (as requested in CONTRIBUTING.md)?

@ycpei
Copy link
Contributor Author

ycpei commented Jun 19, 2017

@jgm test/vimwiki-reader.html was the output of pandoc -f vimwiki -t html -s --css data/vimwiki.css -o vimwiki-reader.html as a test easy for a human eye to see that the html output of the pandoc reader is the same as the vimwiki plugin. It has been removed now.

I have now enforced the 80 column rule.

I also added support for diary links. I only added it now because it relies on configs in the vim plugin of vimwiki. Since there is a default config I'm using that, namely the diary links like [[diary:yyyy-mm-dd]] points to diary/yyyy-mm-dd.html.

| s2 == "" = (s1, s2)
| head s2 == '#' = (s1, s2)
| otherwise = divByHash (s1 ++ [head s2]) (tail s2)

Copy link
Owner

Choose a reason for hiding this comment

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

If the point of this function is to split a string on a prefix not containing # and a suffix starting with #, why not use the Prelude function break?

procLink s = procLink' x ++ y
  where (x, y) = break (=='#') s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know break - thanks for pointing it out.

y <- many p2
z <- p6
return $ mconcat $ x:y++[z]
p2 :: PandocMonad m => VwParser m Blocks
Copy link
Owner

Choose a reason for hiding this comment

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

You should put a blank line between the two function defs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jgm jgm merged commit 564c779 into jgm:master Jun 19, 2017
@jgm
Copy link
Owner

jgm commented Jun 19, 2017

Thanks very much for this contribution. There may be further problems that appear, but I think this is in good shape to merge.

@ycpei
Copy link
Contributor Author

ycpei commented Jun 19, 2017

Thanks very much for merging. I'll keep an eye on issues related to this reader. Also feel free to @ me whenever a problem appears.

@ycpei ycpei deleted the vimwiki branch June 20, 2017 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants