Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Support templates #21

Closed
chipsenkbeil opened this issue Sep 14, 2020 · 1 comment
Closed

Support templates #21

chipsenkbeil opened this issue Sep 14, 2020 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

Each template could look like:

     <html>
     <head>
         <link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
         <title>%title%</title>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     </head>
     <body>
         <div class="content">
         %content%
         </div>
         <p><small>Page created on %date%</small></p>
     </body>
     </html>

where
%title% is replaced by a wiki page name or by a |vimwiki-title|
%date% is replaced with the current date or by |vimwiki-date|
%root_path% is replaced by a count of ../ for pages buried in subdirs:
if you have wikilink [[dir1/dir2/dir3/my page in a subdir]] then
%root_path% is replaced by '../../../'.
%wiki_path% Path to current wiki-file.` The file path to the current wiki
file. For example, if you are on page a/b.wiki %wiki-path% contains
"a/b.wiki". Mostly useful if you want to link the to raw wiki page from
the rendered version.

%content% is replaced by a wiki file content.

The default template will be applied to all wiki pages unless a page specifies
a template. Consider you have wiki page named 'Maxim.wiki' and you want apply
'person.html' template to it. Just add: >
%template person
to that page.

@chipsenkbeil chipsenkbeil added this to the 0.2 milestone Sep 14, 2020
@chipsenkbeil chipsenkbeil added this to To do in vimwiki-server via automation Sep 14, 2020
@chipsenkbeil chipsenkbeil removed this from the 0.2 milestone Oct 8, 2020
@chipsenkbeil chipsenkbeil added this to To do in vimwiki-core via automation Oct 21, 2020
@chipsenkbeil chipsenkbeil added this to the 0.1 milestone Oct 21, 2020
@chipsenkbeil chipsenkbeil added the enhancement New feature or request label Oct 21, 2020
@chipsenkbeil chipsenkbeil modified the milestones: 0.2, 0.1 May 19, 2021
@chipsenkbeil
Copy link
Owner Author

Being done as part of #63.

vimwiki-server automation moved this from To do to Done May 19, 2021
vimwiki-core automation moved this from To do to Done May 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
vimwiki-core
  
Done
Development

No branches or pull requests

1 participant