Write notes in LaTeX format, directly from the command line. Organize the notes in notebooks. Automatically create a notebook for the current day if no other notebook is selected. View and edit the notes of each day or notebook. Select one or more notebooks or a certain timerange and export them to a PDF file, or merge them into a new notebook.
For lnote to work, you need to create an executable script with the name “lnote”, which is calling the function call(), like this:
>>> import sys, lnote
>>> if __name__ == '__main__':
>>> sys.exit(lnote.call())
The default data directory is “~/data/lnote”. It can be overwritten by setting the environment variable LNOTE_DIR.
Merge several notebooks into another (append all source notebooks to the target notebook). If the target notebook does not exist, create it.
Open notebook in a text editor. If multiple notebooks are given, open them side by side.
Export a notebook or selection of notebooks (for now only to PDF format).
View a notebook or a selection of notebooks.
To do: –> add -l/–line option to select a line or a range of lines
Add text to a notebook. This can be any LaTeX-compatible code.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add a linebreak (an empty line) to a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add a section to a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add a titled paragraph to a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add an equation to a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add a figure to a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
To do: –> determine size of the graphics file and choose width and height
accordingly
Remove the last line of a notebook.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
To do: –> negative numbers remove lines from the beginning of the notebook
Add a list item to a notebook. If the notebook ends with a list of the chosen type, continue that list.
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Add a marginal note to the notebook (using the LaTeX command “marginpar”).
If the selected notebook does not exist, it is created. By default, today’s notebook is used.
Print the strings in the given list in column by column (similar the bash command “ls”), respecting the width of the shell window. If ret is True, give back the resulting string instead of printing it to stdout.
Return the ceiling of x. This exists as a substitute for numpy.ceil, to avoid importing the huge numpy module just for this function.
Try to get the width of the shell window (will only work on Unix systems).
Convert option string to a certain date. Return as Julian day number (integer).
Convert option string to a list of dates. Return list of integers (Julian day numbers).
Convert option string to a timerange. Return as tuple with two integers (JDN1, JDN2+1) (Julian day numbers).
Convert option string to a list of timeranges. Return as list of tuples with two integers (JDN1, JDN2+1) (Julian day numbers).
Convert Gregorian date to Julian day number. Reference: http://en.wikipedia.org/wiki/Julian_Date
Convert Julian day number to Gregorian date. Reference: http://en.wikipedia.org/wiki/Julian_Date
Select a single notebook based on the given pattern. If forgiving is True, create a new notebook if the given one doesn’t exist. Otherwise, only create a new notebook if pattern is None or empty.
If abs(number) == 1, return “”, otherwise return “s”. For conveniently appending the plural “s” to words depending on some number.
Return total size of a file or directory in bytes.
Reference: http://stackoverflow.com/questions/1392413/calculating-a-directory-size-using-python