dlang.org endpoint for permanent links to DIPs

Seb seb at wilzba.ch
Wed Jun 3 18:22:34 UTC 2020


On Wednesday, 3 June 2020 at 17:42:26 UTC, Dennis wrote:
> On Wednesday, 3 June 2020 at 13:25:05 UTC, Seb wrote:
>> I guess the easiest/quickest option is to add redirects to 
>> dlang.org.
>> This can be done by adding "Redirect 301 /dips/1028 
>> https://github.com/.../"
>>
>> https://github.com/dlang/dlang.org/blob/master/.htaccess
>
> I didn't know about that file, that is very useful.
> I think manually adding redirects is a great start.
>
>> However, I think this will require quite a bit of manual 
>> maintenance and is easy to forget, so the best option is to 
>> render the Markdown into HTML automatically at the DIPs 
>> repository, which can then continuously be deployed to e.g. 
>> dips.dlang.org
>
> It's better than the current situation where every instance of 
> a link to a DIP is a maintenance problem. Would it be hard to 
> automatically update the redirects file based on the DIP 
> respository?

It certainly won't be easy as the tech stack of dlang.org is 
rather old. With the current setup it would probably need to be a 
bot that monitors commits to dlang/dips, parses the current DIP 
list, updates the .htaccess based on this and opens this as a PR 
if the diff changed. Not super hard, but certainly not an hour's 
work.
Furthermore, a lot of people won't be aware that the links from 
GitHub can break and might not even know about dips.dlang.org

>> If someone is interested in doing this little project, it can 
>> be done entirely with D, e.g.
>>
>> https://vibed.org/api/vibe.textfilter.markdown/filterMarkdown
>>
>> For deployment with Netlify + D, a netlify.sh and netlify.toml 
>> are required. Something like this:
>
> That sounds a bit more complicated than needed.

Not sure, it's not that hard to use:

https://run.dlang.io/is/zWgHH2

All that's missing is to detect the title, loop over all dips and 
generate a ToC.

Vibe.d's Markdown package is also used to render the package 
READMEs on code.dlang.org and while it used to not support some 
features of GitHub-flavored Markdown (GFM) compatibility, this 
compatibility is not a huge issue these days anymore at least 
with a recent Vibe.d (see e.g. the recent 
https://github.com/vibe-d/vibe.d/pull/2446).
Though I do admit that using a Markdown package that provides 
100% well-tested feature parity with GFM might be an alternative 
approach, but it wouldn't be dog-feeding Vibe.d + D.

> DDoc now supports markdown, so if they should be hosted on the 
> site, couldn't they simply become .dd files in the dlang.org 
> repository?

Well, the Markdown supported by Ddoc has been limited to "only 
the useful parts" by Walter. That's why the documentation calls 
it "Markdown inspired", e.g. 
https://dlang.org/changelog/2.087.0.html#ddoc_markdown
I guess it might work with most DIPs, but if one doesn't even try 
to have feature parity with normal Markdown folks are going to be 
very confused (and I'm not even talking about GitHub-flavored 
Markdown).

BTW dlang.org already uses Vibe.d its ddox documentation, so 
there wouldn't be a big "hurdle" of using it to render a few more 
pages.


More information about the Digitalmars-d mailing list