Re: years and categories (was Odd error in wbgwiki.py with numeric only directories)

Blake Winton <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
>>> I'll try to work up a specification for this but probably won't get to
>>> it for a while.  Though I'd really appreciate it if someone else could
>>> write it.
>> Since I appear to be the one with the big ideas, the least I can do is
>> write the spec...  ;)  (Also, I'm on vacation all next week, and so
>> should have a fair bit of time to work on it.)

Hah!  Taking care of a 4-year-old doesn't actually leave one any spare 
time.  Ah, the naiveté of my one-week-ago self.  :)

> That'd really help.  A million thank yous!

And here we go.  It's still a first cut, any comments will be most 
gratefully appreciated.

To see what it'll actually look like, you can paste it into 
http://www.hosting4u.cz/jbar/rest/rest.html or just open up the attached 
html file, which is the result of the last time I did just that.  ;)

Thanks,
Blake.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
pyblosxom-users mailing list
pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users
archiveaccess.rest (text/plain, 3.1 KB)
==============
Archive Access
==============

:Author: Blake Winton <bwinton plus pyblosxom at latte dot ca>
:Originally published: September 20, 2007
:URL: http://pyblosxom.sourceforge.net/2.0/plans/archiveaccess.html


History
=======

September 20, 2007 - Blake Winton

   * Wrote the initial document, emailed it to pyblosxom-devel.


Summary
=======

In previous versions of PyBlosxom, any url which contained a path
segment of four digits was treated as a request for the archives for
that path.  This led to people attempting to create directories named,
say, "1234", and having them not work, because the archive handler would
take over, and return no entries for the year 1234.

There are other plugins which assign different meanings to parts of the
path, but they all require the path to start with a prefix, thus
allowing the user to name their directories whatever they want.

This proposal is intended to sketch out how the archive access for the
next version of PyBlosxom should work, with the goals of allowing easy
access to the archives, as well as allowing users to name directories
whatever they like.


Proposed design
===============

Currently, PyBlosxom jumps through some hoops to process numeric
directories as years.  While it does allow you to more easily view
archives of categories, I believe there is a simpler way to achieve the
same feature.

The path /dev/2003/ always contains the stuff in the /dev/2003 folder.

The items in the dev/2003 folder created in 2002 (Note: I'm using 2002
here for disambiguation, so that we know which part is the folder name,
and which part is the path.) could be:

1. /archive/2002/dev/2003 , or

2. /archive/2002?dev/2003 , or

3. /dev/2003?archive/2002 , or

4. /archive/2002/entries/dev/2003 . (This last one is to get around a root directory named "07"...)


Discussion
==========

The main failings with options 2 and 3 are the use of the question mark.
Due to that, I suggest discounting them.  That leaves us with options 1
and 4.  The trade-off between those, as I see it, is that option 1
restricts what I can name my top-level directories, whereas option 4 is
too verbose for my liking.  The verbosity could be fixed by choosing a
shorter prefix, such as: /old/2002/\@/dev/2003, or /\@/2002/in/dev/2003...
For that matter, the prefix should probably come out of config.py, like
other prefixes, so that if the user decides to have an "old", or
"archive" top-level category, they can change the archive's prefix to
"previous", or "ancient".  (Similarly, if the user uses a different
locale, they can name it "Архив", or "vieux", or "vorhergehend".)

The thread that got me complaining about this issue is at:
http://sourceforge.net/mailarchive/forum.php?thread_name=20070913214155.GB30850%40newred.gradwell.net&forum_name=pyblosxom-users

The thread where I promised to write this spec is at:
http://sourceforge.net/mailarchive/forum.php?thread_name=185aeadc0709140845t16b98868s96bcaa1ac86533a3%40mail.gmail.com&forum_name=pyblosxom-users


Outstanding issues
==================

1. The main outstanding issue is that I don't know if people are really
interested in changing this.
archiveaccess.html (text/html, 10.3 KB)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/"><title>Archive Access</title>

<meta name="author" content="Blake Winton &lt;bwinton plus pyblosxom at latte dot ca&gt;">
<style type="text/css">

/*
:Author: David Goodger
:Contact: [email protected]
:Date: $Date$
:Revision: $Revision$
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0 }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 ! important }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 ! important }

.last, .with-subtitle {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dl.docutils dd {
  margin-bottom: 0.5em }

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em ;
  margin-right: 2em }

div.footer, div.header {
  clear: both;
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin-left: 1em ;
  border: medium outset ;
  padding: 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em }

h1.title {
  text-align: center }

h2.subtitle {
  text-align: center }

hr.docutils {
  width: 75% }

img.align-left {
  clear: left }

img.align-right {
  clear: right }

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font-family: serif ;
  font-size: 100% }

pre.literal-block, pre.doctest-block {
  margin-left: 2em ;
  margin-right: 2em ;
  background-color: #eeeeee }

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80% }

table.citation {
  border-left: solid 1px gray;
  margin-left: 1px }

table.docinfo {
  margin: 2em 4em }

table.docutils {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.footnote {
  border-left: solid 1px black;
  margin-left: 1px }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap ;
  padding-left: 0 }

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100% }

tt.docutils {
  background-color: #eeeeee }

ul.auto-toc {
  list-style-type: none }

</style></head><body>
<div class="document" id="archive-access">
<h1 class="title">Archive Access</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name">
<col class="docinfo-content">
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Blake Winton &lt;bwinton plus pyblosxom at latte dot ca&gt;</td></tr>
<tr class="field"><th class="docinfo-name" colspan="2">Originally published:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">September 20, 2007</td>
</tr>
<tr class="field"><th class="docinfo-name">URL:</th><td class="field-body"><a class="reference" href="http://pyblosxom.sourceforge.net/2.0/plans/archiveaccess.html">http://pyblosxom.sourceforge.net/2.0/plans/archiveaccess.html</a></td>
</tr>
</tbody>
</table>
<div class="section">
<h1><a id="history" name="history">History</a></h1>
<p>September 20, 2007 - Blake Winton</p>
<blockquote>
<ul class="simple">
<li>Wrote the initial document, emailed it to pyblosxom-devel.</li>
</ul>
</blockquote>
</div>
<div class="section">
<h1><a id="summary" name="summary">Summary</a></h1>
<p>In previous versions of PyBlosxom, any url which contained a path
segment of four digits was treated as a request for the archives for
that path.  This led to people attempting to create directories named,
say, "1234", and having them not work, because the archive handler would
take over, and return no entries for the year 1234.</p>
<p>There are other plugins which assign different meanings to parts of the
path, but they all require the path to start with a prefix, thus
allowing the user to name their directories whatever they want.</p>
<p>This proposal is intended to sketch out how the archive access for the
next version of PyBlosxom should work, with the goals of allowing easy
access to the archives, as well as allowing users to name directories
whatever they like.</p>
</div>
<div class="section">
<h1><a id="proposed-design" name="proposed-design">Proposed design</a></h1>
<p>Currently, PyBlosxom jumps through some hoops to process numeric
directories as years.  While it does allow you to more easily view
archives of categories, I believe there is a simpler way to achieve the
same feature.</p>
<p>The path /dev/2003/ always contains the stuff in the /dev/2003 folder.</p>
<p>The items in the dev/2003 folder created in 2002 (Note: I'm using 2002
here for disambiguation, so that we know which part is the folder name,
and which part is the path.) could be:</p>
<ol class="arabic simple">
<li>/archive/2002/dev/2003 , or</li>
<li>/archive/2002?dev/2003 , or</li>
<li>/dev/2003?archive/2002 , or</li>
<li>/archive/2002/entries/dev/2003 . (This last one is to get around a root directory named "07"...)</li>
</ol>
</div>
<div class="section">
<h1><a id="discussion" name="discussion">Discussion</a></h1>
<p>The main failings with options 2 and 3 are the use of the question mark.
Due to that, I suggest discounting them.  That leaves us with options 1
and 4.  The trade-off between those, as I see it, is that option 1
restricts what I can name my top-level directories, whereas option 4 is
too verbose for my liking.  The verbosity could be fixed by choosing a
shorter prefix, such as: /old/2002/@/dev/2003, or /@/2002/in/dev/2003...
For that matter, the prefix should probably come out of config.py, like
other prefixes, so that if the user decides to have an "old", or
"archive" top-level category, they can change the archive's prefix to
"previous", or "ancient".  (Similarly, if the user uses a different
locale, they can name it "Архив", or "vieux", or "vorhergehend".)</p>
<p>The thread that got me complaining about this issue is at:
<a class="reference" href="http://sourceforge.net/mailarchive/forum.php?thread_name=20070913214155.GB30850%40newred.gradwell.net&amp;forum_name=pyblosxom-users">http://sourceforge.net/mailarchive/forum.php?thread_name=20070913214155.GB30850%40newred.gradwell.net&amp;forum_name=pyblosxom-users</a></p>
<p>The thread where I promised to write this spec is at:
<a class="reference" href="http://sourceforge.net/mailarchive/forum.php?thread_name=185aeadc0709140845t16b98868s96bcaa1ac86533a3%40mail.gmail.com&amp;forum_name=pyblosxom-users">http://sourceforge.net/mailarchive/forum.php?thread_name=185aeadc0709140845t16b98868s96bcaa1ac86533a3%40mail.gmail.com&amp;forum_name=pyblosxom-users</a></p>
</div>
<div class="section">
<h1><a id="outstanding-issues" name="outstanding-issues">Outstanding issues</a></h1>
<p>1. The main outstanding issue is that I don't know if people are really
interested in changing this.</p>
</div>
</div>

</body></html>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.