Git Product home page Git Product logo

dream-note's Introduction

dreamnote

Write my dream journal with (Neo)vim and compile it into this beautiful LaTeX Template.

Feature

  • Editor automatically opens at the right location of the LaTeX source
  • Compile and view your document easily
  • Count the number of dreams you have wrote down
  • Automatic version control of the source
  • Modular organisation of the LaTeX source (1 latex file for each month)

How to install ?

  1. The script depends on the following tools:

    • python 3.6
    • vim or neovim
    • curl (used to download the template)
    • unzip (used to extract the template archive)
    • perl (used for some text processing tasks)
    • texlive (the typesetting system)
    • xdg-utils (used to open the pdf)
    • git (set up with a name and an email address)
    • rubber (used to parse compilation error log)

    For exemple on archlinux: pacman -S neovim curl unzip perl texlive-most xdg-utils git rubber

  2. Clone this repository and run the makefile:

cd /tmp
git clone https://github.com/nicodebo/dream-note
cd dream-note
make

The make command will do the following:

  • The template configuration file will be copied to $XDG_CONFIG_HOME/dreamnote/dreamrc
  • A python virtual environment will be created under $XDG_DATA_HOME/dreamnote/venv
  • This repository will be copied to $HOME/bin/dream-note
  • A symlink of the dreamnote main executable is created under $HOME/bin ($HOME/bin should be in your $PATH in order to run dreamnote from every location)

Note:

  • You can change the directory of the virtual environment and the directory where the source are installed by invoking make in the following manner:
    make venv_dreamnote=/path/to/dreamnote/venv source_dir=/path/to/dreamnote/source
    and make sure /path/to/dreamnote/source is in your $PATH
  • To update:
    # go to directory where the source are installed
    cd /path/to/dreamnote/source # or cd $HOME/bin/dream-note if you ran bare make 
    # get the latest dreamnote source 
    git pull
    # to update the virtual environment
    make
  • To change the directory of the virtual environment after the first installation change the venv_rootvalue of the dreamnote configuration file launch make to build the venv.

How to use

Help

Usage:
dreamnote [Option]
A personal tool to create and manage my dream journal

Options:
-h, -help       Display this help message and exit
-i <name>       Initialize a dream note named <name> in the current
                directory
-a              Insert a dream at the current date in the dream note
-A <date>       Insert a dream at a user specified date. <date> must be in
                the YYYY-MM-DD format with YYYY=[0000;9999], MM=[01-12] and
                DD=[01-31].
-c              Compile the main tex file into a pdf with latexmk and the
                pdflatex compiler and open the resulting pdf in the default
                previewer.
-s              Compute and display some dream informations

Example

  1. Open a terminal and move to the directory where you want your dream journal source to be located.

  2. Initialize an empty dream journal:

    dreamnote -i my_dream_journal

    The hereabove command will create a folder, named my_dream_journal, where the contents of the journal will be located (LaTeX source). Some folder structuring is done and a first git commit is automatically done (if git is available).

  3. Write down the dream of the past night:

    dreamnote -a

    Neovim (or vim) pops up with a section containing today's date and right below a subsection filled in with dummy text. Change the text with a nice dream title and start typing your dream under the subsection. Add as many dream as you want (or remember) by adding new subsection. When finished, save and quit the editor and a git commit will be automatically done, taking into account the fresh modifications. Note: add a flag to your dream titles. (n), (pl), and (l) respectively for normal dream, pre-lucid dream, lucid dream. (i.e. \subsection{dream title (l)}) Alternatively, no flag represent a normal dream. This is useful if you want to count the number of normal, pre-lucid and lucid dream with dreamnote -s option.

  4. Visualize your dream journal:

    dreamnote -c
    

    This command will compile and display the resulting pdf in your default pdf viewer. Errors will be displayed if there is any, as well as warnings.

Structure of the latex document

The latex document is organized as shown in the following tree:

<name> (name of the dream note)
│   main.tex
│
└───contents
    │
    └───part1 (ex: 2016)
        │   part.tex (ex: 2016.tex)
        │
        └───chapters
        │      01.tex
        │      02.tex
        │      ...
        │
        part2
        │
        ...

Each year is represented as a folder with the name of the year and contains a part.tex file which input all the chapter of the corresponding directory. Each chapter represents a month [01-12] of the year and each one is input in the part.tex file. At a higher level the main.tex file import each part.tex. Dreams are written each day (ideally) in chapters file (ex: 01.tex).

dream-note's People

Contributors

nicodebo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.