Skip to content

Commit 8a57d88

Browse files
authored
Merge pull request #2284 from wilzbach/xml2ddoc
Use the dlang.org's XML stream at feedburner to convert the latest articles to ddoc macros
2 parents 8d4c81b + 5b7c814 commit 8a57d88

File tree

5 files changed

+287
-33
lines changed

5 files changed

+287
-33
lines changed

dblog_feed_example.xml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
3+
4+
<channel>
5+
<title>The D Blog</title>
6+
7+
<link>https://dlang.org/blog</link>
8+
<description>The official blog for the D Programming Language.</description>
9+
<lastBuildDate>Mon, 19 Mar 2018 13:27:32 +0000</lastBuildDate>
10+
<language>en-US</language>
11+
<sy:updatePeriod>hourly</sy:updatePeriod>
12+
<sy:updateFrequency>1</sy:updateFrequency>
13+
<generator>https://wordpress.org/?v=4.9.4</generator>
14+
<site xmlns="com-wordpress:feed-additions:1">112438176</site> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OfficialDBlog" /><feedburner:info uri="officialdblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
15+
<title>DConf 2018 Programme &amp; Open Registration</title>
16+
<link>https://dlang.org/blog/2018/03/19/dconf-2018-programme-open-registration/</link>
17+
<comments>https://dlang.org/blog/2018/03/19/dconf-2018-programme-open-registration/#respond</comments>
18+
<pubDate>Mon, 19 Mar 2018 13:27:32 +0000</pubDate>
19+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
20+
<category><![CDATA[D Foundation]]></category>
21+
<category><![CDATA[DConf]]></category>
22+
23+
<guid isPermaLink="false">http://dlang.org/blog/?p=1493</guid>
24+
<description><![CDATA[Registration for DConf 2018 Munich, May 2-5, is open! 21 hours of engaging presentations and panels, an all-day Hackathon, and intelligent conversation with members of the D programming language community! We have keynotes from language stewards Walter Bright and Andrei Alexandrescu, along with our invited guest from academia Martin Odersky, professor at EPFL and creator of the Scala language. Whether you know nothing of DLang or you're a seasoned pro, we invite you to spend 4 days with us to partake in the fun, the education, and the German beer. Check the programme and register today!]]></description>
25+
<wfw:commentRss>https://dlang.org/blog/2018/03/19/dconf-2018-programme-open-registration/feed/</wfw:commentRss>
26+
<slash:comments>0</slash:comments>
27+
<post-id xmlns="com-wordpress:feed-additions:1">1493</post-id> </item>
28+
<item>
29+
<title>User Stories: Funkwerk</title>
30+
<link>https://dlang.org/blog/2018/03/14/user-stories-funkwerk/</link>
31+
<comments>https://dlang.org/blog/2018/03/14/user-stories-funkwerk/#comments</comments>
32+
<pubDate>Wed, 14 Mar 2018 14:06:32 +0000</pubDate>
33+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
34+
<category><![CDATA[Code]]></category>
35+
<category><![CDATA[Community]]></category>
36+
<category><![CDATA[Companies]]></category>
37+
<category><![CDATA[Guest Posts]]></category>
38+
<category><![CDATA[User Stories]]></category>
39+
40+
<guid isPermaLink="false">http://dlang.org/blog/?p=1479</guid>
41+
<description><![CDATA[In this post, we cap off the Funkwerk series with the launch of a new feature we creatively call “User Stories”. Now and again, we’ll publish a post in which D users talk of their experiences with D, not about specific projects, but about the language itself. They’ll tell of things like their favorite features, why they use it, how it has changed the way they write code, or anything they’d like to say that expresses how they feel about programming in D.]]></description>
42+
<wfw:commentRss>https://dlang.org/blog/2018/03/14/user-stories-funkwerk/feed/</wfw:commentRss>
43+
<slash:comments>3</slash:comments>
44+
<post-id xmlns="com-wordpress:feed-additions:1">1479</post-id> </item>
45+
<item>
46+
<title>The D Language Foundation at Open Collective</title>
47+
<link>https://dlang.org/blog/2018/03/12/the-d-foundation-at-open-collective/</link>
48+
<comments>https://dlang.org/blog/2018/03/12/the-d-foundation-at-open-collective/#respond</comments>
49+
<pubDate>Mon, 12 Mar 2018 14:20:54 +0000</pubDate>
50+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
51+
<category><![CDATA[Community]]></category>
52+
<category><![CDATA[D Foundation]]></category>
53+
54+
<guid isPermaLink="false">http://dlang.org/blog/?p=1441</guid>
55+
<description><![CDATA[In its work guiding the development of D and promoting its adoption, the D Language Foundation is driven primarily by donations big and small. The money comes in from different sources, the most visible being those listed on the website’s donation page, and is put to use in different ways. Today, the D Language Foundation is opening a new chapter in the donation story.]]></description>
56+
<wfw:commentRss>https://dlang.org/blog/2018/03/12/the-d-foundation-at-open-collective/feed/</wfw:commentRss>
57+
<slash:comments>0</slash:comments>
58+
<post-id xmlns="com-wordpress:feed-additions:1">1441</post-id> </item>
59+
<item>
60+
<title>The New New DIP Process</title>
61+
<link>https://dlang.org/blog/2018/03/09/the-new-new-dip-process/</link>
62+
<comments>https://dlang.org/blog/2018/03/09/the-new-new-dip-process/#comments</comments>
63+
<pubDate>Fri, 09 Mar 2018 12:49:07 +0000</pubDate>
64+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
65+
<category><![CDATA[Community]]></category>
66+
<category><![CDATA[Core Team]]></category>
67+
68+
<guid isPermaLink="false">http://dlang.org/blog/?p=1437</guid>
69+
<description><![CDATA[When I took on the role of DIP Manager last year, my number one goal was to clear out the queue. I made a few revisions to the process and got busy. Over the next few months, things went along fairly well, not so much from anything I did as from the quality of the submissions. But at some point, things broke down and the process stalled.]]></description>
70+
<wfw:commentRss>https://dlang.org/blog/2018/03/09/the-new-new-dip-process/feed/</wfw:commentRss>
71+
<slash:comments>3</slash:comments>
72+
<post-id xmlns="com-wordpress:feed-additions:1">1437</post-id> </item>
73+
<item>
74+
<title>LDC 1.8.0 Released</title>
75+
<link>https://dlang.org/blog/2018/03/06/ldc-1-8-0-released/</link>
76+
<comments>https://dlang.org/blog/2018/03/06/ldc-1-8-0-released/#respond</comments>
77+
<pubDate>Tue, 06 Mar 2018 13:56:15 +0000</pubDate>
78+
<dc:creator><![CDATA[LDC Developers]]></dc:creator>
79+
<category><![CDATA[Compilers & Tools]]></category>
80+
<category><![CDATA[Guest Posts]]></category>
81+
<category><![CDATA[LDC Releases]]></category>
82+
<category><![CDATA[News]]></category>
83+
84+
<guid isPermaLink="false">http://dlang.org/blog/?p=1428</guid>
85+
<description><![CDATA[The LDC developers are proud to announce the release of version 1.8.0, following a short year and a half from the 1.0 release. This version integrates version 2.078.3 of the D front-end, which is itself written in D, making LDC one of the most prominent mixed D/C++ codebases.]]></description>
86+
<wfw:commentRss>https://dlang.org/blog/2018/03/06/ldc-1-8-0-released/feed/</wfw:commentRss>
87+
<slash:comments>0</slash:comments>
88+
<post-id xmlns="com-wordpress:feed-additions:1">1428</post-id> </item>
89+
<item>
90+
<title>DMD 2.079.0 Released</title>
91+
<link>https://dlang.org/blog/2018/03/03/dmd-2-079-0-released/</link>
92+
<comments>https://dlang.org/blog/2018/03/03/dmd-2-079-0-released/#respond</comments>
93+
<pubDate>Sat, 03 Mar 2018 12:00:30 +0000</pubDate>
94+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
95+
<category><![CDATA[Code]]></category>
96+
<category><![CDATA[Compilers & Tools]]></category>
97+
<category><![CDATA[Core Team]]></category>
98+
<category><![CDATA[DMD Releases]]></category>
99+
<category><![CDATA[News]]></category>
100+
101+
<guid isPermaLink="false">http://dlang.org/blog/?p=1408</guid>
102+
<description><![CDATA[It’s not always easy to choose which enhancements or changes from a release to highlight on the blog. What’s important to some will elicit a shrug from others. This time, there's so much to choose from that my head is spinning. But two in particular stand out as having the potential to result in a significant impact on the D programming experience, especially for those who are new to the language.]]></description>
103+
<wfw:commentRss>https://dlang.org/blog/2018/03/03/dmd-2-079-0-released/feed/</wfw:commentRss>
104+
<slash:comments>0</slash:comments>
105+
<post-id xmlns="com-wordpress:feed-additions:1">1408</post-id> </item>
106+
<item>
107+
<title>The State of D 2018 Survey</title>
108+
<link>https://dlang.org/blog/2018/02/28/the-state-of-d-2018-survey/</link>
109+
<comments>https://dlang.org/blog/2018/02/28/the-state-of-d-2018-survey/#respond</comments>
110+
<pubDate>Wed, 28 Feb 2018 13:30:49 +0000</pubDate>
111+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
112+
<category><![CDATA[Community]]></category>
113+
<category><![CDATA[Core Team]]></category>
114+
<category><![CDATA[News]]></category>
115+
<category><![CDATA[State of D]]></category>
116+
117+
<guid isPermaLink="false">http://dlang.org/blog/?p=1400</guid>
118+
<description><![CDATA[This is your chance to turn your praise, complaints, and nitpicks into action. By participating in the State of D survey, you'll be providing guidance to the D Language Foundation to help identify both short and long-term goals for the future development of D and its ecosystem.]]></description>
119+
<wfw:commentRss>https://dlang.org/blog/2018/02/28/the-state-of-d-2018-survey/feed/</wfw:commentRss>
120+
<slash:comments>0</slash:comments>
121+
<post-id xmlns="com-wordpress:feed-additions:1">1400</post-id> </item>
122+
<item>
123+
<title>DConf 2018 Munich: The Venue</title>
124+
<link>https://dlang.org/blog/2018/02/23/dconf-2018-munich-the-venue/</link>
125+
<comments>https://dlang.org/blog/2018/02/23/dconf-2018-munich-the-venue/#respond</comments>
126+
<pubDate>Fri, 23 Feb 2018 13:38:00 +0000</pubDate>
127+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
128+
<category><![CDATA[D Foundation]]></category>
129+
<category><![CDATA[DConf]]></category>
130+
131+
<guid isPermaLink="false">http://dlang.org/blog/?p=1386</guid>
132+
<description><![CDATA[This is our first time in Munich, and if you can pad out your visit by two or three days, there’s a lot to see while you’re there. The venue is the NH Munich Messe hotel, located in the Zamdorf area of the city.]]></description>
133+
<wfw:commentRss>https://dlang.org/blog/2018/02/23/dconf-2018-munich-the-venue/feed/</wfw:commentRss>
134+
<slash:comments>0</slash:comments>
135+
<post-id xmlns="com-wordpress:feed-additions:1">1386</post-id> </item>
136+
<item>
137+
<title>Project Highlight: The D Community Hub</title>
138+
<link>https://dlang.org/blog/2018/02/17/project-highlight-the-d-community-hub/</link>
139+
<comments>https://dlang.org/blog/2018/02/17/project-highlight-the-d-community-hub/#respond</comments>
140+
<pubDate>Sat, 17 Feb 2018 12:46:19 +0000</pubDate>
141+
<dc:creator><![CDATA[Michael Parker]]></dc:creator>
142+
<category><![CDATA[Community]]></category>
143+
<category><![CDATA[Compilers & Tools]]></category>
144+
<category><![CDATA[Project Highlights]]></category>
145+
146+
<guid isPermaLink="false">http://dlang.org/blog/?p=1381</guid>
147+
<description><![CDATA[Sometimes projects are abandoned. Sometimes they aren&#8217;t updated as frequently as users would like. This can become an issue for those who depend upon these projects, but it&#8217;s alleviated by the fact that most D projects are open source and their repositories are publicly available. All it takes to keep a project alive and up-to-date are more volunteers willing to pitch in. That&#8217;s the motivation behind the <a href="https://tour.dlang.org/">dlang-community organization</a> at GitHub.]]></description>
148+
<wfw:commentRss>https://dlang.org/blog/2018/02/17/project-highlight-the-d-community-hub/feed/</wfw:commentRss>
149+
<slash:comments>0</slash:comments>
150+
<post-id xmlns="com-wordpress:feed-additions:1">1381</post-id> </item>
151+
<item>
152+
<title>Vanquish Forever These Bugs That Blasted Your Kingdom</title>
153+
<link>https://dlang.org/blog/2018/02/07/vanquish-forever-these-bugs-that-blasted-your-kingdom/</link>
154+
<comments>https://dlang.org/blog/2018/02/07/vanquish-forever-these-bugs-that-blasted-your-kingdom/#comments</comments>
155+
<pubDate>Wed, 07 Feb 2018 13:07:26 +0000</pubDate>
156+
<dc:creator><![CDATA[Walter Bright]]></dc:creator>
157+
<category><![CDATA[BetterC]]></category>
158+
<category><![CDATA[Code]]></category>
159+
<category><![CDATA[Core Team]]></category>
160+
161+
<guid isPermaLink="false">http://dlang.org/blog/?p=1350</guid>
162+
<description><![CDATA[Do you ever get tired of bugs that are easy to make, hard to check for, often don’t show up in testing, and blast your kingdom once they are widely deployed? They cost you time and money again and again. If you were only a better programmer, these things wouldn’t happen, right?]]></description>
163+
<wfw:commentRss>https://dlang.org/blog/2018/02/07/vanquish-forever-these-bugs-that-blasted-your-kingdom/feed/</wfw:commentRss>
164+
<slash:comments>4</slash:comments>
165+
<post-id xmlns="com-wordpress:feed-additions:1">1350</post-id> </item>
166+
</channel>
167+
</rss>

dlang.org.ddoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,7 @@ DDOCKEYVAL2=$(DIVC keyval $1, $(SPANC key key$1, $2:) $(DIVC val val$1, $(TAIL $
144144
DDSUBLINK=$(LINK2 $(ROOT_DIR)$1.html#$2, $3)
145145
_=
146146

147-
DBLOG_LATEST_AUTHOR=A D enthusiast
148-
DBLOG_LATEST_DATE=December 17, $(YEAR)
149-
DBLOG_LATEST_LINK=https://dlang.org/blog
150-
DBLOG_LATEST_TITLE=An article from the DBlog about `DIFFABLE=1`
151-
DBLOG_LATEST_AUTHOR2=A D-eveloper
152-
DBLOG_LATEST_DATE2=December 5, $(YEAR)
153-
DBLOG_LATEST_LINK2=https://dlang.org/blog
154-
DBLOG_LATEST_TITLE2=Yet another article that will be replaced with real content
147+
155148
DMDSRC=$(HTTPS github.com/dlang/dmd/blob/master/src/dmd/$0, $0)
156149
DOT_PREFIXED=.$1$(DOT_PREFIXED $+)
157150
DOT_PREFIXED_SKIP=$(DOT_PREFIXED $+)

index.dd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ $(DIVC boxes,
365365
$(TOUR newspaper-o, News,
366366
$(P Stay updated with the latest posts in the
367367
$(LINK2 http://blog.dlang.org,
368-
<cite>Official D Blog</cite>) from $(DBLOG_LATEST_DATE):
369-
$(LINK2 $(DBLOG_LATEST_LINK), $(DBLOG_LATEST_TITLE)) by
370-
$(DBLOG_LATEST_AUTHOR).
368+
<cite>Official D Blog</cite>) from $(DBLOG_LATEST_DATE_1):
369+
$(LINK2 $(DBLOG_LATEST_LINK_1), $(DBLOG_LATEST_TITLE_1)) by
370+
$(DBLOG_LATEST_AUTHOR_1).
371371
)
372372
$(P
373-
From $(DBLOG_LATEST_DATE2):
374-
$(LINK2 $(DBLOG_LATEST_LINK2), $(DBLOG_LATEST_TITLE2)) by
375-
$(DBLOG_LATEST_AUTHOR2).
373+
From $(DBLOG_LATEST_DATE_2):
374+
$(LINK2 $(DBLOG_LATEST_LINK_2), $(DBLOG_LATEST_TITLE_2)) by
375+
$(DBLOG_LATEST_AUTHOR_2).
376376
)
377377
)
378378
$(TOUR graduation-cap, Learn,

posix.mak

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ CHANGE_SUFFIX = \
220220
mv $$f `dirname $$f`/`basename $$f .$1`.$2 ; \
221221
done
222222

223-
# Caches the latest D blog post for the front page
224-
DBLOG_LATEST=
225-
226223
# Disable all dynamic content that could potentially have an unrelated impact
227224
# on a diff
228225
ifeq (1,$(DIFFABLE))
@@ -231,7 +228,6 @@ ifeq (1,$(DIFFABLE))
231228
else
232229
CHANGELOG_VERSION_MASTER := "v${LATEST}..upstream/master"
233230
CHANGELOG_VERSION_STABLE := "v${LATEST}..upstream/stable"
234-
DBLOG_LATEST=$G/dblog_latest.ddoc $G/dblog_latest2.ddoc
235231
endif
236232

237233
################################################################################
@@ -314,7 +310,7 @@ STYLES=$(addsuffix .css, $(addprefix css/, \
314310
# HTML Files
315311
################################################################################
316312

317-
DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME) $(DBLOG_LATEST)
313+
DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME) $G/dblog_latest.ddoc
318314
STD_DDOC_LATEST=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST}) $(NODATETIME)
319315
STD_DDOC_RELEASE=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-release) $(NODATETIME)
320316
STD_DDOC_PRERELEASE=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-prerelease ${GENERATED}/modlist-prerelease) $(NODATETIME)
@@ -579,21 +575,18 @@ $G/dlangspec.verbatim.txt : $G/dlangspec-consolidated.d $(DDOC_BIN) verbatim.ddo
579575
# Fetch the latest article from the official D blog
580576
################################################################################
581577

582-
$G/dblog_latest.html:
578+
ifeq (1,$(DIFFABLE))
579+
$G/dblog_latest.xml: dblog_feed_example.xml
580+
@echo "Create a dummy DBlog XML stream due to DIFFABLE=1"
581+
cp $< $@
582+
else
583+
$G/dblog_latest.xml:
583584
@echo "Receiving the latest DBlog article. Disable with DIFFABLE=1"
584-
curl -s --fail --retry 3 --retry-delay 5 -L https://blog.dlang.org -o $@
585-
586-
$G/dblog_latest.ddoc: $G/dblog_latest.html
587-
cat $< | grep -m1 'entry-title' | \
588-
sed -E 's/^.*<a href="(.+)" rel="bookmark">([^<]+)<\/a>.*<time.*datetime="[^"]+">([^<]*)<\/time>.*Author *<\/span><a [^>]+>([^<]+)<\/a>.*/DBLOG_LATEST_TITLE=\2|DBLOG_LATEST_LINK=\1|DBLOG_LATEST_DATE=\3|DBLOG_LATEST_AUTHOR=\4/' | \
589-
tr '|' '\n' > $@
590-
@if [ ! -s $@ ] ; then echo "$@ is empty. Please check the download"; rm -f $@; exit 1 ; fi
591-
cat $< | grep -m2 'entry-title' | tail -n1 | \
592-
sed -E 's/^.*<a href="(.+)" rel="bookmark">([^<]+)<\/a>.*<time.*datetime="[^"]+">([^<]*)<\/time><time class="updated".*Author *<\/span><a [^>]+>([^<]+)<\/a>.*/DBLOG_LATEST_TITLE2=\2|DBLOG_LATEST_LINK2=\1|DBLOG_LATEST_DATE2=\3|DBLOG_LATEST_AUTHOR2=\4/' | \
593-
tr '|' '\n' > $(basename $@)2.ddoc
594-
@if [ ! -s $(basename $@)2.ddoc ] ; then echo "$(basename $@)2.ddoc is empty. Please check the download"; rm -f $(basename $@)2.ddoc; exit 1 ; fi
595-
596-
$G/dblog_latest2.ddoc: $G/dblog_latest.ddoc
585+
curl -s --fail --retry 3 --retry-delay 5 -L http://feeds.feedburner.com/OfficialDBlog -o $@
586+
endif
587+
588+
$G/dblog_latest.ddoc: $G/dblog_latest.xml $(STABLE_DMD) tools/ddoc_xml_extractor.d
589+
$(STABLE_RDMD) tools/ddoc_xml_extractor.d -i $< -o $@
597590

598591
################################################################################
599592
# Git rules

0 commit comments

Comments
 (0)