This is a static site created using the pelican static site generator. The data is imported from an Excel file into CSV, then displayed using the Javascript D3 library.
The pelican site content is in the content
directory. The data is in the
data
directory. The javascript for displaying data is in the js
directory.
Pelican can use Markdown,
reStructuredText or Plain HTML to
make pages. For simple pages, markdown is preferred. You can find a simple
cheat-sheet,
guide,
the creators page, and
the offical spec helpful. Markdown files should use
the .md
extension. The primary goal of markdown is to have a text file that
is well laid-out to edit and read in plain text format, and the rules of layout
can also be leveraged to generate HTML (or PDF, Word Doc, etc) from it.
To work on the site, setup pelican so that it generates the pages on your local machine. This requires python 3 to be installed on your computer.
Requires automake and bash to be installed on your system in addition to
python3
being in your path.
It is important that there are no spaces in the directories above where your
repo is located. For example if you are running from
/home/me/My Git Repos/municipalityBudgetsSTL
, consider moving the directory
to something like /home/me/git_repos/municipalityBudgetsSTL
.
- From the repo run
./make_venv.bash
to create a python virtual environment. (Or just runpython3 -m venv .venv
.) - Execute
source .venv/bin/activate
to enter the virtual environment in your terminal. This only applies to this terminal, you must run this for each terminal you wish to use pelican from. - Execute
pip install -r requirements.txt
to install pelican and its pre-requisites. - Execute
make devserver
to generate the pelican site in theoutput
directory and start serving it on http://localhost:8000. - Modify files and they will be immediately updated in the served version.
- When complete, run
make stopserver
to stop the running server.
This all works better on POSIX systems, if you would like to have that on windows, you can install Cygwin to get this all working from within your windows box.
Requires Python 3 to be installed on your computer, and accessible as the first
python
command found in your PATH
.
- Run
run_windows.bat
to do the following for you.- Create a python virtual environment
- Activate the virtual environment for the script
- Install the required components of pelican in your virtual environment
- Generate the pelican site in the
output
- Start serving the site on http://localhost:8000
- Make changes to source files, javascript, data, etc.
- Press Ctrl+C in the terminal serving the Site
- Re run
run_windows.bat
to generate and start serving again.
Requires Python 3 to be installed on your computer, and accessible as the first
python
command found in your PATH
.
Requires Git to be installed on your computer, and the following to be run from the "Git Bash" command prompt.
- From the root of the repo run the
run_windows.bash
command prompt. This will do the following:- If it doesn't already exist, create a python virtual environment in the
.venv
directory. - Activate the virtual environment for the script
- Install the required components of pelican in your virtual environment
- Start serving the site on http://localhost:8000. This will automatically regenerate content as it is editing.
- If it doesn't already exist, create a python virtual environment in the
- Make changes to the content, refresh the page in your web browser to see
the changes. (Test it by adding
markdown
text to the
pages\about.md
file.) - Run
stop_windows.bash
to stop the server.
Start by installing Cygwin on your computer. Cygwin functions very much like a linux operating system, which has been compiled to run on your windows computer. It isn't great with graphical applications (some work, some are iffy), but is great for command line tools.
- From the main Cygwin page, click on the link for setup-x86_64.exe to download the installer.
- Run the installer.
- For download source, select
Install from Internet
. - The root directory of
C:\cygwin64
is probably fine. - Pick anywhere for the
Local Package Directory
, once the install is complete, this can be deleted. - Select a mirror from the list of "Available Download Sites". Probably an http:// one.
- Pick packages you want to install from the categorized list. The easiest
way to find specific ones is with the search box. Click on the package line
where it says "Skip" to change it to a specific version number to mark it
for installation.
These are required for the script:
python3
python3-pip
make
You might also like these:git
openssh
Feel free to add anything else you see that is interesting.
Once the Cygwin install is complete, open it (from the desktop icon or start menu). Then run the following:
- Change to the directory of your code. For example if the repo is at
C:\Users\me\git\municipalityBudgetsSTL
, then entercd /cygdrive/c/Users/me/git/municipalityBudgetsSTL
.- It is important that there are no spaces in the directories above where
your repo is located. For example if you are running from
C:\Users\me\My Git Repos\municipalityBudgetsSTL
, consider moving the directory to something likeC:\Users\me\git_repos\municipalityBudgetsSTL
.
- It is important that there are no spaces in the directories above where
your repo is located. For example if you are running from
- Create a python virtual environment
python3 -m venv .venv
.- Don't re-use one created in one of the above methods, if it already
existed, run
rm -rf .venv
to remove it.
- Don't re-use one created in one of the above methods, if it already
existed, run
- Execute
source .venv/bin/activate
to enter the virtual environment in your terminal. This only applies to this terminal, you must run this for each terminal you wish to use pelican from. - Execute
pip install -r requirements.txt
to install pelican and its pre-requisites. - Execute
make devserver
to generate the pelican site in theoutput
directory and start serving it on http://localhost:8000. - Modify files and they will be immediately updated in the served version.
- When complete, run
make stopserver
to stop the running server.