Package: journalmk
JournalmkCreates a pdf notebook/journal out of journal/xournal/xournalpp/... notes,
using python, latex and the pdf export capabilities of the respective
note taking app.While it was designed to layout xournalpp notes (*.xopp) well-arranged in a pdf
document, it can be used with all sorts of digital content/notes which can be
converted to a pdf document, likepictures (*.jpg, *.png, ...)office documents (*.odt, *.doc, *.xls, ...)ipynb jupyter notebooks (*.ipynb).markup content (*.html, *.svg, ...)QuickstartTo build a pdf journal out of your digital notes, justcreate a empty directory (the build directory) with a name you likeplace an empty json file, with the namejournalmkrc.jsonin this directoryadd the following lines to this json file{
    "root_directory": [".."],
    "notes_directory_names": ["_notes"],
    "notes_pdf_export_commands": {
        "xopp": "xournalpp {xopp} -p {pdf}"
    },
    "journal_type": "chronological",
    "datetime_journal_format": "%d. %B %Y -- %H:%M",
}install journalmkand execute the commandjournalmkfrom the build directory.The root directory of the journalThe directory where journalmk is searching notes (the root directory) can be
specified under theroot_directorykey in the configuration filejournalmkrc.json. The build directory can lay inside or outside of the root
directory. Relative paths, as in the example, are relative to the build
directory.The directory name(s) for the notesUnder the keynotes_directory_names, all directory names can be speciefied,
in which notes can be located. Usally, this list is not to long, since in most
cases a user has only one default identifier (for example_notes) which is
used system wide, to specify the location where notes can be found.If no directory name is given, all files under the root directory are considered
as notes.The filename format(s) of the notesThe timestamp of a single note will be parsed from the filename. If this fails,
the timestamp will be grabbed from the creation time of the file. While the
latter works fine as long you are always on the same device with the same os,
issues may occur if you switch the one or the other, so it is not recommended
for long time use cases. Timestamp formats can be provided in the
journalmkrc.json, e.g.:"datetime_filename_formats": ["%Y-%m-%d-Note-%H-%M", "Note--%Y-%m-%d--%H-%M"]A pdf conversation commandFor each notes file type a pdf export/conversation command has to be provided.
For xournalpp note, for example, one has to add the respective command in the
following format to thejournalmkrc.json:"notes_pdf_export_commands": {
  "xopp": "xournalpp {xopp} -p {pdf}"
}The conversation commands for other types of files can be added to this list:"notes_pdf_export_commands": {
  "xopp": "xournalpp {xopp} -p {pdf}",
  "ipynb": "jupyter nbconvert {ipynb} --to pdf --output {pdf}",
  "jpg": "convert {jpg} {pdf}"
}The above placeholder{xopp},{jpg},{ipynb}will then be replaced with
the respective filename (full path) of the note and{pdf}will be replaced the
pdf filename (full path), to be export.A pdf in-place conversation commandFor some types of notes no command exists where the full path of the pdf file
can be specified (for example odt files). Instead the respective commands
provide inplace conversation, only. Thes commands has to be provided in the
seperat list:"notes_pdf_inplace_export_commands": {
    "odt": "libreoffice --convert-to pdf {odt}"
},In this list also a output directory can be specified (if necessary):"notes_pdf_inplace_export_commands": {
    "odt": "libreoffice --convert-to pdf {odt} --outdir {outdir}"
},The string"{pdf}"should not appear innotes_pdf_inplace_export_commandsentries and the string"{outdir}"should not appear innotes_pdf_export_commandsentries,
since they will not be replaced in these scenarios.Notes from a certain period of timeTo build a journal with notes from a cetain period of time,
this period can be specified by start and end time, as follows"journal_period": ["2019-03-01--16-30", "2020-03-01--16-30"],or by a time span given in minutes, for example for all notes from the last
half year:"journal_period": [262800]Ignore files and foldersDirectories can be ignored by specifying there full paths,
for example"exclude_directories": [
  ["/", "home", "user", "Projects", "journalmk", "journalmk", "example"]
],and notes can be ignored by specifying there endings, for example"exclude_note_endings": ["autosave.xopp"]The resulting pdf fileHyperlink to the noteAt the end of the first page of each note, included in thejournal.pdf,
a hyperlink to the original source file can be found. By clicking on this
hyperlink the file can be directly opened with the appropriate note taking
application. Therefore, depending on the os, some further system configuration may be
neceessary.Journal typeBy default the notes will be aligned chronological in the resultingjournal.pdffile. To order the notes by topic one can add the following
line to thejournalmkrc.json:"journal_type": "topological"Therefore, in each notes directory, a additionaljournalmk.jsoncan be
placed to provide the name of the topic (part), subtopic (chapter) and
subsubtopic (section), for example:{
  "part": "Writing",
  "chapter": "Novels",
  "section": "Working title"
}or{
  "part": "Housebuilding",
  "chapter": "Living room",
  "section": "Windows and lightning"
}Date and time formatThe format of timestamps in the resulting pdf document/journal
can be defined in thejournalmkrc.json.
Default:"datetime_journal_format": "%d. %B %Y -- %H:%M""week_number_format": "Week %W""month_year_journal_format": "%B""year_journal_format": "%Y"Global journalmkrc.jsonAll configurations which apply user-wide to (almost) all journalmk
projects can be placed in the.journalmkrc.jsonfile, located in the
users home directory. These settings will then be loaded for all projects
by default and overwritten with the settings from the
project-specificjournalmkrc.jsonfile. To ignore this user-wide configuration
file in certain cases, the following line can be added to the
project-specificjournalmkrc.json:"ignore_user_home_journalmkrc": trueInstallationJournalmk is actually just a python script, but also packaged
and available on the python package index (PyPI). It can be
used without any installation as python script from the command line,
or it can be installed with a package installer, like pip:most recent release from PyPI (recommended)pip install journalmkmost recent commit from the master branchpip install git+https://github.com/riemarc/journalmk.gitRequirementsPython >= 3.8LaTex (with packages: latexmk, koma-script, minitoc, pdfpages, graphics, datetime, hyperref)Without installationThe commandjournalmkis only available when the package is installed.
If you want to use  journalmk without installation, placejournalmk.pyin the build
directory and executepython journalmk.py.NotesTested under Ubuntu 20.04 with Texlive 2019 and Python 3.8.Designed to be cross-platform, but only tested under Linux.