Convert a Sitemap to a DITA Map

Sitemap class>>#asXML

asXML ^ (Wiki status , '/sitemap.xml') asFileReference

[…]

sitemapXML := Sitemap asXML

XMLHTMLParser parse: sitemapXML

locs := (XMLHTMLParser parse: sitemapXML) document xPath: 'self::node()//url//loc'

transcript := GtTranscript new.

locs do: [ :aString | transcript show: aString ]

locs do: [ :aString | transcript show: aString ]

[…]

Or using `sitemap.json` instead of `sitemap.xml` with

Sitemap get slugs

Sitemap get slugs

[…]

Slug class>>#asHDITA

<!DOCTYPE html> <html> <head> <title>01 Story and Journal</title> </head> <body> <article id="01-story-and-journal"> <h1>Story and Journal</h1> <p>We introduce the parts of a Federated Wiki page. The "story" is a collection of paragraphs and paragraph like items. The "journal" collects story edits. Should you take my page and edit it as yours, I can see what you've done and may decide to take your edits as my own</p> <p> <div class="item"><p>YOUTUBE 2R3LM_A7Cg4 Ward introduces the parts of a Federated Wiki page.</p> </div> </article> </body> </html>

Map class

* `dita.map`:

<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd"> <map> <topicref href="markdown-dita-topic.md" format="markdown"/> <topicref href="hdita.html" format="hdita" navtitle="HDITA"/> <topicref href="01-story-and-journal.html" format="hdita" navtitle="01 Story and Journal"/> </map>

**Attention**: The HDITA map format is not yet supported. To include HDITA content, use an XDITA map or a DITA 1.3 map. page

The code example above shows a working `dita.map` file.

dita -i dita.map -f pdf

out

The resulting pdf.