Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mechanism for treating .txt file as .opml, with documentation; …
…released as 1.0.2. The core of this change is the :treatasopml directive, which is the signal in a .txt file to convert the body of the page to an Opml object. This change involved, first, a modification to Opml.new (initialize), since I had foolishly assumed that the parameter would always be a pathname string; whereas now it must be either a Pathname (to a file to be read, consisting of OPML) or a string (consisting of OPML). Second, a class method Opml.textToOpml was added, to convert indented text (very elegantly!) to OPML. In PageMaker, runOutlineDirectives no longer converts adrObject to a string before passing it along to Opml.new, since the fact that it is a Pathname is now the sign that it indicates a file to be read. And, finally, in PageMaker, in runDirectives, having read the scalar directives from the start of a .txt file, we immediately look to see whether :treatasopml is true and, if so, convert the rest of the page to OPML (using Opml.textToOpml) and hand it off to Opml.new to get an Opml object just as would be the case if this were a .opml file; notice that we also set :treatasopml to false to prevent the same thing happening again later when template directives are read (skanky but simple).
- Loading branch information
Showing
9 changed files
with
81 additions
and
14 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
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
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
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