Fredrik Unger [Tue, 22 Jan 2019 20:10:26 +0000 (21:10 +0100)]
sitemap: support for draft, levels and templates
Adding support for using article status attribute to indicate
if a document is just a draft. Adding the article attribute
userlevel to create 5 access levels. Access control is not
implemented but the differen sites can be uploaded to different
areas which is protected by for example apache access.
This makes sure that one content source is used for each site.
Adding template support by using the article attribute role to
select the style template to generate the page.
Fredrik Unger [Tue, 22 Jan 2019 19:47:03 +0000 (20:47 +0100)]
image: improving xmp support
Adding some new support for writing resized files, pusing the
caption to thouse files. Returning if False if xmp is missing.
Fredrik Unger [Tue, 22 Jan 2019 19:42:57 +0000 (20:42 +0100)]
table: adding link support in simple tables
The code cans for special patterns that can be urls or addresses with email.
It convert thouse parts to active docbook links that in turn gets translated
into real html links when the site is published.
Fred [Mon, 13 Feb 2017 20:07:28 +0000 (21:07 +0100)]
include; table - better character support
adding codecs to table parsing, enabling utf-8 support
Fred [Mon, 13 Feb 2017 20:05:55 +0000 (21:05 +0100)]
sitemap/resource: adding minus in path, adding video
Adding minus - in the path parsing
Adding support for video, collecting and uploading video
Fredrik Unger [Tue, 31 Mar 2015 12:26:49 +0000 (14:26 +0200)]
photoalbum: rewote to use the image object
Utilizing the image transformation code in the image class
to deal with generating the phonoalbum instead of having
two implementations transforming files.
Fredrik Unger [Tue, 31 Mar 2015 12:25:54 +0000 (14:25 +0200)]
tools: adding error and warning calls
Adding calls to error and warning to simplify error reporting
to standard error.
Fredrik Unger [Tue, 31 Mar 2015 12:24:28 +0000 (14:24 +0200)]
docbook: expand image objects per page
Introducing expanded docbook parts for images. Captions are
read from the image file and the image file is appropriately
resized.
Fredrik Unger [Tue, 31 Mar 2015 12:22:17 +0000 (14:22 +0200)]
image: improve image handling, caption, resize
Files being resized are marked as resized by treecutter.
Captions are read from the xmp description.
Fredrik Unger [Fri, 27 Feb 2015 09:20:19 +0000 (10:20 +0100)]
xinclude: photoalbum caption and gallery
Adding the caption listed in description. Generating
a gallery that then also can be used by the stylesheets.
Fredrik Unger [Fri, 27 Feb 2015 09:19:23 +0000 (10:19 +0100)]
sitemap: adding sizecalculation
With large projects it is good to know the size to be uploaded.
This does not yet take into accoun the style files resources.
Fredrik Unger [Fri, 27 Feb 2015 09:18:27 +0000 (10:18 +0100)]
page: template added instead of style
Adding the parsed template into page instead of just the pointer to style.
Fredrik Unger [Fri, 27 Feb 2015 09:16:29 +0000 (10:16 +0100)]
page: using lxml transform, simple docbook & image
Switching from external call to use the internal lxml xslt transform.
Creating a class for docbook and image to separate out
docbook specific code and image specific code.
Fredrik Unger [Fri, 20 Feb 2015 14:53:39 +0000 (15:53 +0100)]
path: adding suport for a site in a subdir
This was added to support referencing css etc in a example.com/subdir
setting. Creating different sites within a site.
Fredrik Unger [Fri, 20 Feb 2015 14:51:58 +0000 (15:51 +0100)]
path: adding support for . in directoies
This was done as directories with : were not allowed
in Windows, and switching to . caused problems with the links relying
on the index.langcode.xml format.
Fredrik Unger [Fri, 20 Feb 2015 14:47:15 +0000 (15:47 +0100)]
const: adding xml namespace
Adding the XML namespace http://www.w3.org/XML/1998/namespace
Fredrik Unger [Fri, 7 Mar 2014 11:36:18 +0000 (12:36 +0100)]
style: switching to xhtml5 and sass
Switching the template to be a xhtml5 template and start using
sass in the css composition.
With separate template it will also be possible to do pdf print pages.
Fredrik Unger [Fri, 7 Mar 2014 11:34:04 +0000 (12:34 +0100)]
filesystem: fixing utf-8 issues switching to jinja
Switching to work fully with utf-8 files also for the sitemap.txt
Switching to template engine jinja2 for better unicode support.
Templates has to be refreshed.
Fredrik Unger [Wed, 5 Mar 2014 18:07:19 +0000 (19:07 +0100)]
trie: fixed xhtml generation
Added missing closure of </li>.
Fredrik Unger [Tue, 17 Dec 2013 14:32:17 +0000 (15:32 +0100)]
style: improve the simple template address style
Simple adjustments to block and whitespace to improve
address presentation.
Fredrik Unger [Tue, 17 Dec 2013 14:30:56 +0000 (15:30 +0100)]
xinclude: added pic and latests plugins
pic includes several versions of the image and scales it accordingly
latests creates a list of the latest X articles with images if availible
Fredrik Unger [Tue, 17 Dec 2013 14:29:32 +0000 (15:29 +0100)]
page: added a warning for missing resources
When a picture or resource is missing treecutter issues a simple
warning.
Fredrik Unger [Fri, 6 Dec 2013 21:18:48 +0000 (22:18 +0100)]
Added subdir argument, cleaned up arg handling
Added the subdir argument to allow to put a treecutter site on
a deeper level than just www.example.org/ now also
www.example.org/subdir can be used.
Argument handling was changed so that sitemap gets all arguments in
its constructor as it deals the arguments at different stages.
All arguments are handed to sitemap that then distribute the needed
arguments.
Fredrik Unger [Fri, 30 Aug 2013 12:12:00 +0000 (14:12 +0200)]
page: added ability to encrypt linktargets
Links with attribute 'security'=='encrypt' will be encrypted
with gpg using symetric key. This to ease sharing of sensitive
documents.
Fredrik Unger [Thu, 29 Aug 2013 12:58:30 +0000 (14:58 +0200)]
style: adding a very simple style
Adding a simple but elegant style for websites with only articles
and no need for flashy menues or language menues
Fredrik Unger [Tue, 30 Jul 2013 08:27:59 +0000 (10:27 +0200)]
xinclude: First attempt at a photoalbum
Fredrik Unger [Tue, 30 Jul 2013 08:26:23 +0000 (10:26 +0200)]
menues: Fixed non-ascii char in locale strings
Fredrik Unger [Wed, 6 Feb 2013 12:16:20 +0000 (13:16 +0100)]
README: added a simple readme with disclaimer
License has not yet been picked. If there is any interest in the project
feedback would be interesting.
Fredrik Unger [Wed, 6 Feb 2013 10:55:46 +0000 (11:55 +0100)]
tools: fixed problem with local test
The ssh_cmd needed a host to do the command, but for local tests
a host is not availible. Test for host and if not availible run locally.
rsync does not need that check.
Fredrik Unger [Fri, 25 Jan 2013 11:06:58 +0000 (12:06 +0100)]
sitemap: removing language menu namespace
Removing language menu generation namespace.
It is not needed as it is in html, and namespace confuses and invalidates
the html in the browser, maybe since the attributes were not namespaced.
Fredrik Unger [Fri, 25 Jan 2013 10:32:59 +0000 (11:32 +0100)]
xml: change from amara to lxml
changed xml processing from amara to lxml, mainly due to that lxml is
more actively maintained and availible in distributions.
Some html generation was also changed to lxml, there the namespace could
cause some problems (language menu).
Fredrik Unger [Fri, 18 Jan 2013 10:51:10 +0000 (11:51 +0100)]
page.py: added import re
import re was missing and re was used for a regular expression.
Fredrik Unger [Fri, 18 Jan 2013 10:49:13 +0000 (11:49 +0100)]
address.py: changed update check of address string
If nominatim data does not exists (eg postcode is not there, but boundary or vice
versa) then the old code failed with NoneType object.
This addresses this but is not optimal.
Current tests works with the sites, so using this solution for now.
Fredrik Unger [Wed, 19 Dec 2012 09:46:53 +0000 (10:46 +0100)]
reprepro: presents & generates a Debian repository
Added a new script that presents and generates a Debian repository
for the selected reprepro. It generates links that then assures that
the files also gets moved to the correct location.
Fredrik Unger [Wed, 19 Dec 2012 09:45:28 +0000 (10:45 +0100)]
address: geocode language, objects for mapimages
Added a accept-language header to the nominatim requests.
Started to use Coord objects in mapimages, but still need more work.
Fredrik Unger [Wed, 19 Dec 2012 09:19:37 +0000 (10:19 +0100)]
sitemap: comments, getcwd removed
Aded more comments to the code, and removed a cwd readout.
Fredrik Unger [Wed, 19 Dec 2012 09:17:28 +0000 (10:17 +0100)]
main: changes to time, commments
Changed time.time() to time() by importing from time import time
instead. Added some comments, can be improved.
Fredrik Unger [Thu, 22 Nov 2012 11:38:06 +0000 (12:38 +0100)]
Adding table generation from simple textfile
Original idea stems from dependencies.py in a site which organized a table
from a formated textfile. At the time just from the body of the table.
This version can have a labeled header row in the begining and entries
that are links, with or without title. Title is denoted httplink|title.
For extra text more work is needed. Can only do one word titles for now.
Fredrik Unger [Sun, 11 Nov 2012 19:35:07 +0000 (20:35 +0100)]
Failed lookup does not fail, just do not generate Coords.
A failed lookup used to fail with an error message. That in turn,
disturbs treecutter. Now if Coordinates are not found a Coord element
is not generated. The None values in the Address are converted to ''
or filled by a successful geocode.
Functions c and s needs refining. Empty elements are kept or
destroyed with the clean_db function.
clean_db function can clean code to become invalid xml so
use carefully. clean_db and the s/c functions will have
to be put in a docbook/lxml module at some point.
Fredrik Unger [Sun, 11 Nov 2012 16:11:25 +0000 (17:11 +0100)]
Enable geolocation of address, adding sorting.
Enabled addition of Organization with Address from the Location field.
This information is geocoded and if found displayed.
Sorting was added to sort event objects, change from the earlier
list of event dictionaries.
Pretty printing turne off not to preformat docbook addresses.
Fredrik Unger [Fri, 9 Nov 2012 11:59:58 +0000 (12:59 +0100)]
Creating objects, switching to lxml, made main callable
Rewrote to use objects for Events and Event.
db_xml generation with lxml.
commandline callable using the __main__ setup
Fredrik Unger [Fri, 9 Nov 2012 10:50:33 +0000 (11:50 +0100)]
Contact as Person and Organization object, callable using lxml
The contact processing was rewrited to objects, using lxml for
xml generation. It is also callable from the commandline.
One difficulty is with assigning vCard data to the correct object.
Ex, a telephone number to an address or person.
Currently works well enough to be used in non trivial sites.
Fredrik Unger [Fri, 9 Nov 2012 10:39:55 +0000 (11:39 +0100)]
Objectified Coord and Address methods, made it main callable
Rewrote the classes to use internal data for their methods, fixed sizing
of the png images (made the size really settable).
Geocoding does try several times with different strings before failing.
Address is also now directly callable for simple addresses, without
contact.
Fredrik Unger [Tue, 6 Nov 2012 14:46:36 +0000 (15:46 +0100)]
Renaming calendar to events due to naming collision in vobject.
Fredrik Unger [Sun, 28 Oct 2012 07:22:04 +0000 (08:22 +0100)]
Switching to ElementMaker from Element/SubElement
Fredrik Unger [Sun, 28 Oct 2012 07:13:42 +0000 (08:13 +0100)]
Adding the lxml docbook namespaces.
Fredrik Unger [Sun, 28 Oct 2012 07:12:41 +0000 (08:12 +0100)]
Refactoring const to constants, to provide for lxml docbook namespaces.
Fredrik Unger [Fri, 26 Oct 2012 07:05:13 +0000 (09:05 +0200)]
Adding an initial calendar implementation.
This calendar was developed in another git to begin with.
It worked for displaying a calendar from apple calendar server.
This will be a base for a rewrite.
Fredrik Unger [Fri, 26 Oct 2012 07:01:48 +0000 (09:01 +0200)]
Adding distance calculation to the Coord class
Starting to refactoring the part for plotting muliple coords.
Fredrik Unger [Fri, 26 Oct 2012 07:00:12 +0000 (09:00 +0200)]
Adding docbook namespaces again
Refactoring later to move docbook xml generation to a helper class.
Fredrik Unger [Wed, 17 Oct 2012 13:31:08 +0000 (15:31 +0200)]
Adding classes Address and Coord, moving functions into the classes.
Creating two classes to deal with Coorinates and Addresses.
An address has a coordinate but a coordinate can also be used
by it self. Some helper functions were also moved from contact
as a contact also has addresses and coordinates.
Fredrik Unger [Wed, 17 Oct 2012 13:28:39 +0000 (15:28 +0200)]
Removing StaticOpenStreetMap building real addresses
Instead of concentrating on OpenStreetMap we rebuild the class
to do addresses with coordinates and the occational picture if needed.
Fredrik Unger [Mon, 24 Sep 2012 18:17:41 +0000 (20:17 +0200)]
Renaming addr to a more proper name, will be used to do all address tasks.
Fredrik Unger [Mon, 4 Jun 2012 10:47:31 +0000 (12:47 +0200)]
Adding fonts directory to resources.
This is to include fonts to a site, puting the fonts in a separate
directory than the css.
Fredrik Unger [Mon, 4 Jun 2012 10:45:48 +0000 (12:45 +0200)]
Display xpointer details to simplify debugging.
If there are several xincludes in a document and several
translations it is hard to find the xinclude call that failed.
Priting the xpointer helps localize the problem.
Fredrik Unger [Wed, 16 May 2012 10:44:12 +0000 (12:44 +0200)]
Initial code to build static images from addresses.
This code was developed over time, for the contact.py images.
Parts of it might be replaced by pythonstructures and it migth move
to a separate package if useful.
Fredrik Unger [Wed, 16 May 2012 10:08:02 +0000 (12:08 +0200)]
Fixing UTF-8 encoding for the foreign texts and characters.
Fredrik Unger [Wed, 16 May 2012 10:06:53 +0000 (12:06 +0200)]
Fixing whitespaces for the docbook address.
This is just to properly format the information in the html display.
Could probably be solved elsewhere.
Fredrik Unger [Wed, 16 May 2012 09:44:41 +0000 (11:44 +0200)]
Switching to address based map generation. Divided to subroutines.
The generation was geo: tag based but as there is only one tag per
vcard I switched to address lookup instead.
There are problems with CZ village addresses, and some missing
address tags that has to be added to openstreetmap, but it is a
better longterm solution.
Fredrik Unger [Wed, 16 May 2012 09:41:58 +0000 (11:41 +0200)]
Changed time to be imported and made xinclude execute in the correct directory.
Fredrik Unger [Fri, 6 Apr 2012 11:47:45 +0000 (13:47 +0200)]
Adding a opening hours parser, creates a table from a simple string, with translations
Fredrik Unger [Fri, 6 Apr 2012 05:24:01 +0000 (07:24 +0200)]
Adding initial xinclude for converting selected VCARD to docbook.
Currently reading a VCARDs file, selecting a VCARD based on the
commandline query, and converts it to docbook.
Initial tests with a few VCARDs work. If an address has 2 telephone
numbers, currently only the first is displayed.
If there is only a telephone number and no address, it will not
be displayed in this version.
Fredrik Unger [Fri, 6 Apr 2012 05:22:55 +0000 (07:22 +0200)]
Removing debug printout.
Fredrik Unger [Wed, 4 Apr 2012 12:10:09 +0000 (14:10 +0200)]
Adding initial plugin support for xincludes in documents
Using the pkg_resources to package xinclude scripts that can be
generaly usable. Initial tests works and once more scripts are
adapted they will be added.
Fredrik Unger [Mon, 2 Apr 2012 19:41:54 +0000 (21:41 +0200)]
Fixing the def main function, properly calling it from treecutter.
There are several ways to do this in python and it can be that
it has to be redone. seems to work for now.
Fredrik Unger [Mon, 2 Apr 2012 18:34:17 +0000 (20:34 +0200)]
Adding initial bin/treecutter, and setup.py and package files.
Fredrik Unger [Mon, 2 Apr 2012 14:48:17 +0000 (16:48 +0200)]
Refactoring, using const, removing global variables, passing some new arguments.
This phase was to clean up the use of output and style in several places.
Now passed as arguments to the sections where it is needed.
Tempfile creation also localized.
Fredrik Unger [Mon, 2 Apr 2012 14:44:34 +0000 (16:44 +0200)]
Refactoring, cleaining up imports, setting filemode
Fredrik Unger [Mon, 2 Apr 2012 14:32:55 +0000 (16:32 +0200)]
Refactoring out every class into separate files. main,tools and const are not classes.
Fredrik Unger [Mon, 2 Apr 2012 14:01:30 +0000 (16:01 +0200)]
Preparing refactoring the single source into a python structure
Fredrik Unger [Thu, 8 Mar 2012 16:02:51 +0000 (17:02 +0100)]
Initial support for providing command line arguments to scripts via xpointer.
Accept-Language is also used to provide the script with the wanted language.
For calendar server in first line. For example the language of the country tag.
Roads and telephone numbers are pretty language independant, but country names not.
There might be other tags as well that has different value per language.
The xpointer is "abused" to provide a pointer into the run script.
Fredrik Unger [Thu, 8 Mar 2012 16:02:11 +0000 (17:02 +0100)]
Adding omit_xml_declaration=True to amara call, but does not yet work, considering to move to lxml or similar.
Fredrik Unger [Mon, 6 Feb 2012 21:22:16 +0000 (22:22 +0100)]
Added missing ) to ssh_cmd call
Fredrik Unger [Mon, 6 Feb 2012 21:17:29 +0000 (22:17 +0100)]
Adding target directory and readability with ssh_cmd
Making sure that the target directory exists and that it is
readable after rsync. ssh_cmd added to simplify the call, but is
currently limited to commands with two arguments plus directory.
Can be generalized. subroutine call used to not need to add extra
dependencies at this point.
Fredrik Unger [Mon, 6 Feb 2012 21:17:06 +0000 (22:17 +0100)]
Adding initial support for html forms.
Fredrik Unger [Mon, 6 Feb 2012 14:35:19 +0000 (15:35 +0100)]
Chaning & to xml representation.
Fredrik Unger [Mon, 6 Feb 2012 14:04:19 +0000 (15:04 +0100)]
Adding docbook.xsl for tree-cutter processing
Fredrik Unger [Mon, 6 Feb 2012 12:15:07 +0000 (13:15 +0100)]
Converting the template to work with tree-cutter, adjusting paths, adding template variables.
Fredrik Unger [Mon, 6 Feb 2012 11:12:40 +0000 (12:12 +0100)]
Moving css files to a subdirectory, renaming index.html to template file.
Fredrik Unger [Mon, 6 Feb 2012 11:09:35 +0000 (12:09 +0100)]
Change execute permission on index.html and style.html
Fredrik Unger [Mon, 6 Feb 2012 11:00:47 +0000 (12:00 +0100)]
Reindent css and convert from DOS format to unix format.
Fredrik Unger [Mon, 6 Feb 2012 10:56:57 +0000 (11:56 +0100)]
Reindent html and convert from DOS format to unix format.
Fredrik Unger [Mon, 6 Feb 2012 08:25:06 +0000 (09:25 +0100)]
Added template from freehtml5templates.com/awesomesauce-html5-and-css3-template/
Fredrik Unger [Tue, 3 May 2011 20:39:38 +0000 (22:39 +0200)]
Removed the initial version of tree-cutter.py after refactoring to use objects.
Added total timings.
The removed part has not been in use for quite some time and this was the final cleanup.
Fredrik Unger [Tue, 3 May 2011 20:22:11 +0000 (22:22 +0200)]
Using translated cheetah templates, allowing - in filenames.
Fredrik Unger [Tue, 3 May 2011 20:21:20 +0000 (22:21 +0200)]
Adding shutil for the copying.
Fredrik Unger [Tue, 3 May 2011 20:20:33 +0000 (22:20 +0200)]
Fixing sitemap generation, language menus and resource copying.
Fredrik Unger [Thu, 14 Apr 2011 08:04:08 +0000 (10:04 +0200)]
Adding a css mark for the top menu.
Fredrik Unger [Sun, 10 Apr 2011 19:55:25 +0000 (21:55 +0200)]
Fixing script execution path for current directory, fixing missing page printout.
Fredrik Unger [Sun, 10 Apr 2011 19:49:58 +0000 (21:49 +0200)]
Adding initial language menu support. Adding method lang_menu. Changing templates.
Link needs to be properly intergrated to the html href, translation
started earlier in sitemap and saved per language.
'en' special case as it is the original language of iso_639_3.xml
Updating templates with a Language menu item instead of a Level name
Levelname can be maintained in the template, translations are dynamic
as more pages in other languages gets created.
Problems will arrise when a language page is missing. This is first tests.. :)
Fredrik Unger [Sun, 10 Apr 2011 18:22:37 +0000 (20:22 +0200)]
Fixing missed namechange of variable.
Fredrik Unger [Sun, 10 Apr 2011 14:33:19 +0000 (16:33 +0200)]
Added total timing to compare old for loop to Sitemap process method.
Fredrik Unger [Sun, 10 Apr 2011 14:32:18 +0000 (16:32 +0200)]
Adding method process and publish to mimic the old scripts stages to publish.
Timing added to make sure that the Sitemap class is not slower.
Fredrik Unger [Sun, 10 Apr 2011 14:30:42 +0000 (16:30 +0200)]
Adding method to write a sitemap.txt and writing it when something changed.
missing & removed sets controll if we need a new sitemap.txt
Fredrik Unger [Sun, 10 Apr 2011 14:29:43 +0000 (16:29 +0200)]
Adding gen_menu method also in Sitemap.
Fredrik Unger [Sun, 10 Apr 2011 14:24:37 +0000 (16:24 +0200)]
Implementing generation of a menu, currently only the full menu with and without Page marker.
Fredrik Unger [Sun, 10 Apr 2011 14:22:52 +0000 (16:22 +0200)]
Fixing the inorder iterator. Did not recurse deep enough before.
Fredrik Unger [Sun, 10 Apr 2011 14:21:44 +0000 (16:21 +0200)]
Adding several stage methods in Link that propagates to the Page below.
Fredrik Unger [Sun, 10 Apr 2011 14:20:13 +0000 (16:20 +0200)]
Adding some getters and setters to Class Page.
Fredrik Unger [Sun, 10 Apr 2011 14:18:41 +0000 (16:18 +0200)]
Moving the creation of tmp directory to before the new Class structure.
To be imbedded later.