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
Export to Pelican #258
Export to Pelican #258
Conversation
(don't keep a second copy in `requirements.txt`)
jrnl needs the OSX fixes in version 1.1
…one()` one side effect is that a `pytz` object is returned rather than a string, and so conversion to a string must be done explicitly at run time where needed.
want to maintain the ability to format with the use of just text.
If a line was exactly the length of `linewrap`, the extra space was causing the next line to be blank. But if the line is empty, we need the space to maintain the `| ` sidebar.
Previously, if a user forgot the exact name of a journal, they could check the configuration file to retrieve this information. This patch adds support for performing this task using the jrnl interface. The newly added '-ls' option retrieves the available journals from the jrnl configuration files and displays each journal name on a separate line. This patch also updates the jrnl help display and the usage documentation to reflect these changes.
Closes jrnl-org#176
Awesome! Question: can we name that just YAML instead of Pelican? Also, see the line comments. |
and convert to .format()
Without the first line being `---`, I don't know if it is completely valid YAML
We don't have to call it 'Pelican', I don't know if it's quite YAML. YAML starts and end its front matter with a line containing three dashes For now, I've renamed it 'yaml', and addressed your line comments. Current export example:
|
return u"[Journal exported to {0}]".format(output) | ||
except IOError as e: | ||
return u"[ERROR: {0} {1}]".format(e.filename, e.strerror) | ||
if format is ("yaml" or "yaml-md"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't do what you want it to do. ("yaml" or "yaml-md")
will be computed first and evaluate to "yaml"
(since strings are Truth-y). The correct way is to do if format in ('yaml', 'yaml-md')
. That said, I think we should get rid of yaml-md
. It's technically more correct, however nobody that knows of yaml support will type in yaml-md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pelican-md
was originally introduced in case someone later added a ReStructured Text export for Pelican (the front matter is a different format). In any case, I don't think that will be an issue/confusion with the option named yaml
, so I've removed yaml-md
as you're suggested (see c756770).
Recreated against the 2.0-rc1 branch as #347. (This is against the master branch, so based on 1.9.6). Closing this. |
This allows you to export your JRNL to Pelican formatted Markdown. The exported files have the necessary metadata at the top, and then contain the body of the entry. Files are saved with
.md
extension.These can then be used as source content to generate the files of a Pelican blog.
Example file: