ansigenome
ansigenome copied to clipboard
Make it possible to use $HOME in options_readme_template
Hi
Great project. Is it possible to specify the path to the readme template as follows, where ~
would be expanded as $HOME
?
options_readme_template: ~/.ansigenome/ypid.README.rst.j2
Currently, ansigenome says:
The following template could not be found:
~/.ansigenome/README.rst.j2
or
The following template could not be found:
$HOME/.ansigenome/README.rst.j2
Hello,
Are you having issues with using custom templates? Currently you can put the custom templates anywhere you want. It's up to the include
statement in the template to determine where it's located.
Example: https://github.com/nickjj/ansigenome#custom-readme-template
Which include statement? You mean the:
{% extends "README.md.j2" %}
I meant in order to use a custom template, you have to specify this path in ~/.ansigenome.conf
as options_readme_template
and this must by the full path as far as I understand the source and my tests are confirming that.
Ok, so the issue here is that ~
and $HOME
aren't expanding to /home/ypid
?
Yes.
It will be a few days before I can patch this but using os.path.expanduser
and os.path.expandvars
on this line should do it:
https://github.com/nickjj/ansigenome/blob/4ac66e2a381ebbbbd84f673d96f8a8162a2a13f0/ansigenome/scan.py#L51
All right, no problem. Thanks.