patrickdavey / vimwiki_markdown

A gem to use for converting vimwiki markdown files to html.
MIT License
144 stars 16 forks source link

Linking other files in `path_html` and HTML title #30

Closed MahbubAlam231 closed 4 years ago

MahbubAlam231 commented 4 years ago

1.

a) Say I have two markdown files, first.md, second.md, and first.md refers to the other inside it. Now I run :Vimwiki2HTML on the first one to create first.html neither does it automatically create second.html nor it shows any prompt to convert the second one simultaneously. b) Now if I convert both of them using :Vimwiki2HTML, and open first.html and click on the link of the second file, it shows file doesn't exist. Cause inside first.html second file is linked as path_html/second not as path_html/second.html

Shouldn't first.html, second.html be linked together? How to make the work?

2.

Say I have a markdown file like the following:

---
title: NewFile
created: 18/09/2020 15:13:58 IST
theme: Copenhagen
---

# Header
Some text
.
.
.
_End of file_

After convertion, resulting file looks like the following:


title: NewFile created: 18/09/2020 15:13:58 IST theme: Copenhagen

Header

Some text . . . End of file

How do I get the file to look like this:


NewFile

Header

Some text . . . End of file

This is how pandoc converts it. I couldn't get it done even after fiddling with default.tpl long enough. I don't know much html. Any help will be appreciated.

3.

If I comment a line in markdown like this:

%% a comment

after conversion it is displayed in html like %% a comment. Comments in markdown should remain comments in html. How to get that? Am I doing anything wrong?

patrickdavey commented 4 years ago

Hmmm, I'm not sure. Are you definitely using vimwiki_markdown for your conversion? (did you actually run gem install vimwiki_markdown?). The files certainly ought to be created, but, you should probably be running VimwikiAll2HTML not just Vimwiki2HTML.

This gem uses github flavoured markdown which uses <!-- .... --> as the comment delimiters.

So, I don't think there's anything broken with the gem to be honest, please double check you're actually using the correct markdown format and most importantly that you've installed the gem and are referencing it correctly from your .vimrc , see the setup section for more details :)

MahbubAlam231 commented 4 years ago

I did run sudo gem install vimwiki_markdown. VimwikiAll2HTML and github flavoured markdown comments work. Thanks for your help! Could you please comment on 2? I couldn't get it to work even after changing default.tpl. Maybe I'm missing something, I don't know much html. Is there a way to change default.tpl and get it to work?

patrickdavey commented 4 years ago

You can see my default .tpl here . You can use %date% and %title% markers. There's no concept of a theme however, that you'll have to work out yourself.

If you can learn markdown you can learn html. For what you seem to want to do, changing your .tpl to have something like:

<h1>%title%<h1>
<h2>%date%</h2>
%content%

might work. Sorry - that's as much as I can really help you with - there are tonnes of tutorials on writing HTML so I'm sure you can work it out :). Good luck!

MahbubAlam231 commented 4 years ago

Thanks for taking the time to respond :+1: