Skip to content

ppmotskula/wlex

Repository files navigation

    wLex 4.0
    Copyright (C) 2002-2009 Peeter P. Mõtsküla <peeterpaul@motskula.net>
    Licensed under the GNU General Public License, version 2 or later


== Contents ==

 1. Introduction: what is wLex?
 2. Installation and configuration
 3. License
 4. Special thanks


== 1. Introduction: what is wLex? ==

wLex is a tool for formatting and manipulating the legal acts of the
Republic of Estonia.

wLex came to being because of necessity. When the Law of Obligations
Act was passed, it was almost impossible to read it without some kind
of table of contents (the Act contains 1068 paragraphs). And since I
didn't want to spend money on buying a book version of the Act, I
wrote a script that helped me create the contents. Later, the script
underwent several improvements, and currently does the following:

- reformats the texts of the acts to standards-compliant XHTML
  1.0 (or at least tries to; some acts in eRT contain so much
  invalid HTML that wLex just can't figure out how to fix them);
- adds tables of contents to any acts that conform to the formatting
  rules of Estonian legal acts;
- facilitates one-click comparison of different versions of any given
  act provided that the older versions are present in the database of
  electronic Riigi Teataja (the e-version of the Official Journal);

At first, I wrote wLex in Perl. But although Perl makes it possible to
write really complex regular expressions -- and that's the core of wLex's
logic -- it is not exactly a massively popular language. So, in December 2009,
I decided to learn a bit of PHP and rewrote the entire application from
scratch.

wLex is written in PHP5. It depends on Tidy for cleaning up the HTML of
acts fetched from eRT, and on Text_Diff for comparing the versions of acts.
The friendly URLs are the product of Apache's .htaccess magic, so while
it might be possible to run wLex on a non-Apache web server, there would
certainly be some shortcomings.

wLex is free software licensed under GNU GPL Version 2. You are free
to use, modify and distribute it as you like, but you have to keep all
copyright notes, and if you modify the program, you'll have to change
the $progID string in the script so everybody would know they are
working with a modified version.


== 2. Installation and configuration ==

- Download the source tree from GitHub (or elsewhere), and put the files
  somewhere into the directory tree of your web server. Create an empty
  subdirectory called 'data' in the directory where you put the files.
  The 'data' directory must be writeable to your web server.

- Create wLex configuration file (config.php) using sample-config.php as
  an example, and edit it according to the instructions provided therein.

- If your wLex directory is anything other than /wlex, then you must also
  update your .htaccess accordingly.

- Test your installation by directing your web browser to your
  wLex installation. If something doesn't work, try figuring out
  what's wrong.  You may also contact the author, who **might**
  have time to help you.

- Create sitemap.xml and initialise the local systematic catalogue by
  executing `update.php` within your wLex installation directory.
  Keep in mind that you should do it again periodically (preferably on daily
  basis) so you might want to set up a cron job to do it for you.
  Also, your /robots.txt should contain a reference to the freshly created
  sitemap.xml.

- Enjoy. If you modify the program in any way, please also modify the
  PROG_ID string constant in wLex.php, so that your users would know
  they're working with a modified version.  You may (although you
  don't have to) also let me know what you changed and how.

- If you want to change the help page, modify man.htm. If you want
  to change the visual style, modify style.css. These modifications
  alone do not require that you change the PROG_ID string as long as
  you do not distribute your modified version of wLex.


== 3. License ==

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
USA.


== 4. Special thanks ==

- Eric Bednarz (http://tagsoup.com) for examples in his cookbook that
  helped me hack the CSS in order to make the service also usable to
  the poor Windows users who haven't yet switched to a decent browser.

About

wLex is a front-end for https://www.riigiteataja.ee that adds structured tables of content to the consolidated texts of Estonian legal acts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published