-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the overall process, fixed #0005: link behaviour.
* Refactored the overall process flow. Instead of ``JLPMain`` handling the process, it now reads the command line options and defers to ``Processor`` to handle the actual process. The ``Processor`` instance is responsible for processing one batch of input files and holds all the state that is common to this process. * ``JLPBaseGenerator`` and generators based on it are now only responsible for handling one file, generating output from a source AST. As a consequence state that is common to the overall process is no longer stored in the generator but is stored on the ``Processor`` instance, which is exposed to the generators. * Generators can now be instantiated directly (instead of having just a public static method) and are no longer one-time use. Now the life of a generator is expected to be the same as the life of the ``Processor``. * Fixed inter-doc link behaviour. * Created some data classes to replace the ad-hoc maps used to store state in the generator (now in the ``Processor``)
- Loading branch information
Showing
8 changed files
with
269 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Internal links are not smart enough about cross-file linking. | ||
============================================================= | ||
|
||
There are two main problems with internal linking as it works now: | ||
|
||
1. The links are resolved relative to the directory of the file being processed | ||
when they should be resolved relative to the root output directory. | ||
|
||
For example, consider ``@org id1`` defined in ``dir/file1.src``, then | ||
referenced in ``dir/file2.src`` in this manner: ``[link](jlp://id1``. The | ||
url written in ``dir/file2.html`` is ``dir/file1.html#id1``. However, when | ||
the page is viewed, this url is interpreted relative to the directory of the | ||
current page. So if the docs live at ``file:///docs`` then the url will | ||
resolve to ``file:///docs/dir/dir/file1.src#id1`` instead of | ||
``file:///docs/dir/file1.html#id1``. | ||
|
||
2. The links do substitute the ``html`` suffix to the file names in place of the | ||
files' suffixes. In the above example note that the actual urls end in | ||
``.src`` like the original input files, but the expected url ends in | ||
``.html``. | ||
|
||
========= ========== | ||
Created: 2011-09-08 | ||
Resolved: 2011-09-09 | ||
========= ========== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu, 08 Sep 2011 12:27:26 -0500 | ||
#Fri, 09 Sep 2011 14:26:03 -0500 | ||
name=jlp | ||
version=0.2 | ||
version=0.3 | ||
build.number=1 | ||
lib.local=true | ||
release.dir=release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.jdblabs.jlp | ||
|
||
import com.jdblabs.jlp.ast.Directive | ||
|
||
public class LinkAnchor { | ||
|
||
public String id | ||
public Directive directive | ||
public String sourceDocId | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.