# HG changeset patch # User Oben Sonne # Date 1573045285 -3600 # Wed Nov 06 14:01:25 2019 +0100 # Node ID e2054fcc918f055b153f869ec51512264f32e57d # Parent d3fd3c7a79c059675164dc63280ca93606b588b9 Use make. Update docs and Links (away from BitBucket) diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ *.pyc build/ dist/ +env/ +bin # test files tests/actual diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -1,4 +1,7 @@ syntax: glob +env/ +bin/ +poole tests/actual tests/errors.diff *.pyc @@ -8,4 +11,4 @@ box SNAPSHOT* .settings -.idea/ \ No newline at end of file +.idea/ diff --git a/.travis.yml b/.travis.yml --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,5 @@ - "3.2" - "3.3" - "3.6" -install: - - "pip install markdown" script: - - "cd tests && python run.py" + - "make test" diff --git a/Makefile b/Makefile new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,68 @@ +APP := poole + +# ============================================================================= + +export LC_ALL := en_US.UTF-8 + +VIRTUALENV := virtualenv --python=python3 + +HERE:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +.DEFAULT_GOAL := build + +# ============================================================================= +# clean up +# ============================================================================= + +.PHONY: clean +clean: + rm *.pyc + touch requirements.txt + rm -f env/_done_* + +.PHONY: distclean +distclean: clean + rm -f bin + rm -rf env + +# ============================================================================= +# build +# ============================================================================= + +env/bin/python: + $(VIRTUALENV) env + +env/_done_requirements: requirements.txt + env/bin/pip install -U -r requirements.txt + touch $@ + +bin: + ln -s env/bin + +.PHONY: env +env: env/bin/python bin +env: env/_done_requirements + +define POOLE_BIN +#!/bin/bash + +$(HERE)/env/bin/python $(HERE)/poole.py $$@ +endef +export POOLE_BIN + +poole: poole.py Makefile + @echo "$$POOLE_BIN" > $@ + chmod +x poole + +.PHONY: build +build: env poole + +# ============================================================================= +# tests +# ============================================================================= + +.PHONY: test +test: ## run the test suite +test: build + cd tests && $(HERE)/env/bin/python run.py + diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -27,38 +27,28 @@ [travis-url]: https://travis-ci.org/obensonne/poole [travis-img]: https://travis-ci.org/obensonne/poole.png?branch=master "Build status" -## Requirements - -**You** should know Markdown and optionally Python if you want to use Poole's -dirty content generation capability. - -**Your system** should have installed Python ≥ 3.2 and [python-markdown][pymd]. -Poole has been tested on Linux but should also work on other Unix systems and -Windows (in theory, [report an issue][issues] if it fails). - [markdown]: http://daringfireball.net/projects/markdown/ [pymd]: https://pypi.python.org/pypi/Markdown ## Getting Started -Clone or download ([zip][zip], [tgz][tgz]) the repository and then put -*poole.py* to your *PATH*: +Clone or download ([tgz][tgz]) the repository, run `make` to set up a virtual +env, then make Poole easily runnable via an alias: - $ hg clone http://bitbucket.org/obensonne/poole/ /some/where/poole - $ export PATH=$PATH:/some/where/poole + $ hg clone https://hg.sr.ht/~obensonne/poole /some/where/poole + $ cd /some/where/poole + $ make + $ alias poole=/some/where/poole/poole **TIP**: You might want to add the last command to your `~/.bashrc`. -**Python3**: Download the packages from the *py3* branch ([zip][zip3], -[tgz][tgz3]) or check out the *py3* branch when cloned. - Create and build a site project: $ mkdir /path/to/site/project $ cd /path/to/site/project - $ poole.py --init --theme minimal - $ poole.py --build - $ poole.py --serve + $ poole --init --theme minimal + $ poole --build + $ poole --serve Done. You've just created a website! Browse and watch the example pages which have been created during initialization. To write your @@ -66,12 +56,9 @@ Next to the *miniaml* theme, there are some other [choices available][themes]. -Run `poole.py --build` whenever you've made some changes in the *input* folder. +Run `poole --build` whenever you've made some changes in the *input* folder. -[zip]: http://bitbucket.org/obensonne/poole/get/default.zip -[tgz]: http://bitbucket.org/obensonne/poole/get/default.tar.gz -[zip3]: https://bitbucket.org/obensonne/poole/get/py3.zip -[tgz3]: http://bitbucket.org/obensonne/poole/get/py3.tar.gz +[tgz]: https://hg.sr.ht/~obensonne/poole/archive/tip.tar.gz [themes]: https://bitbucket.org/obensonne/poole/wiki/Themes ## How It Works @@ -297,18 +284,6 @@ [pyopts]: http://docs.python.org/library/optparse.html -### Character encodings - -In case you use non-ASCII characters, check the *encoding* options of Poole. In -most cases working with non-ASCII strings should work straight forward if the -options are set properly (default is *UTF-8*). - -However, be aware that page variables defined within page source files and -derived from a page's file name internally are handled as Python *unicode* -objects. That means if you want to refer to non-ASCII page variable names and -values form within embedded Python code or from `macros.py`, make sure to use -*unicode* strings to reference them. - ### Custom file converters If you use [LESS][] or [CleverCSS][] you'll be happy about the possibility to @@ -388,6 +363,5 @@ ## Feedback -Please use the [issue tracker][issues]. +Please use the mailing list at https://lists.sr.ht/~obensonne/poole -[issues]: http://bitbucket.org/obensonne/poole/issues/ diff --git a/poole.py b/poole.py old mode 100755 new mode 100644 diff --git a/requirements.txt b/requirements.txt new file mode 100644 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,1 @@ +markdown diff --git a/tests/run.py b/tests/run.py --- a/tests/run.py +++ b/tests/run.py @@ -7,7 +7,7 @@ import glob HERE = os.path.dirname(__file__) -POOLE = os.path.join(HERE, "..", "poole.py") +POOLE = os.path.join(HERE, "..", "poole") ACTUAL = os.path.join(HERE, "actual") EXPECTED = os.path.join(HERE, "expected") ERRORS = os.path.join(HERE, "errors.diff")