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

Yuchen Pei added 2 commits Jun 16, 2017
Yuchen Pei
Yuchen Pei
@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)

This comment has been minimized.

@jgm

jgm Jun 19, 2017 Owner

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

This comment has been minimized.

@ycpei

ycpei Jun 19, 2017 Author Contributor

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

This comment has been minimized.

@jgm

jgm Jun 19, 2017 Owner

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

This comment has been minimized.

@ycpei

ycpei Jun 19, 2017 Author Contributor

Done.

@jgm jgm merged commit 564c779 into jgm:master Jun 19, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@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 ycpei:vimwiki branch Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.