Mailing List Archive

display Markdown in apache2?
I've searched for a solution to this and can't find anything appropriate,
which seems... strange, given the significant use of markdown I see.

Can anyone point me at a resource for help getting apache2 to display
Markdown (.md) files as translated to html? I know there are numerous
markdown variants; I'm looking to display Commonmark.

I see a list of implementations:
https://github.com/commonmark/commonmark-spec/wiki/List-of-CommonMark-Implementations

and the reference one:
https://github.com/commonmark/cmark
seems like it should make the process relatively simple.

I'm wondering if a mod-markdown already exists for commonmark.

My particular platform is ubuntu-18.

Thanks,

Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: display Markdown in apache2? [ In reply to ]
On 7/17/2022 6:29 PM, Gary Aitken wrote:
> Can anyone point me at a resource for help getting apache2 to display
> Markdown (.md) files as translated to html?

I did that awhile back:

https://sbw.org/mdhandler/

It was a fun project!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: display Markdown in apache2? [ In reply to ]
>
> Can anyone point me at a resource for help getting apache2 to display
> Markdown (.md) files as translated to html? I know there are numerous
> markdown variants; I'm looking to display Commonmark.
>
I use mod_wsgi to execute a Bottle application I wrote that uses nbconvert
to dynamically render and serve Jupyter notebooks. I’m not sure at the
moment what MD specs are covered in the Jupyter notebook spec itself, but
it works nicely and there’s a lot of flexibility to tune the notebook
content (markdown or python or otherwise) with nbconvert. You should be
able to find these software on GH
Re: display Markdown in apache2? [ In reply to ]
Thanks for the replies.

On 7/17/22 7:36 PM, Steve Williams wrote:
> On 7/17/2022 6:29 PM, Gary Aitken wrote:
>> Can anyone point me at a resource for help getting apache2 to display
>> Markdown (.md) files as translated to html?
>
> I did that awhile back:
>
> https://sbw.org/mdhandler/

So... I'm trying to either write a mod_xxx,
or get mod_markdown from
https://github.com/hamano/apache-mod-markdown
to work.

I'm totally unskilled in this area, so am trying to get some logging
to see what's actually being called.

I'm trying to register two modules with the server:
mod_markdown
mod_commonmark

When I bounce the server, I see the following:
[markdown:debug] [pid 26801:tid 140068510301120] mod_markdown.c(738): markdown_hook_check_config: markdown_conf found? true
which is printed from an ap_log_error call in markdown_hook_check_config.

However, I see no similar line for commonmark, which has a similar call
in its commonmark_hook_check_config.
There is no output for either in errors.log.

mod_commonmark register_hooks:
static void register_hooks(apr_pool_t *pool)
{
ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, "mod_commonmark:register_hooks");

(void)pool;
ap_hook_check_config(commonmark_hook_check_config, NULL, NULL, APR_HOOK_LAST);
ap_hook_handler(commonmark_handler, NULL, NULL, APR_HOOK_LAST);
}

static int commonmark_hook_check_config(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{
(void)pconf;
(void)plog;
(void)ptemp;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "commonmark_hook_check_config called");
return OK;
}

commonmark.load in apache2/mods-available looks like:
LoadModule commonmark_module /usr/lib/apache2/modules/mod_commonmark.so
with a symlink in mods-enabled.

apache2.conf contains:
LogLevel warn commonmark:debug markdown:debug

mysite.conf in apache2/sites-available contains:
AddHandler markdown .md
AddHandler commonmark .md
inside the virtual host definition.

It feels like something is not working in the early mod_commonmark loading
process, but I haven't a clue how to debug this.

Any hints would be much appreciated.

Thanks,

Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: display Markdown in apache2? [ In reply to ]
On 7/19/22 9:42 PM, Gary Aitken wrote:
> Thanks for the replies.
>
> On 7/17/22 7:36 PM, Steve Williams wrote:
>> On 7/17/2022 6:29 PM, Gary Aitken wrote:
>>> Can anyone point me at a resource for help getting apache2 to
>>> display Markdown (.md) files as translated to html?
>>
>> I did that awhile back:
>>
>> https://sbw.org/mdhandler/
<snip>
> When I bounce the server, I see the following: [markdown:debug] [pid
> 26801:tid 140068510301120] mod_markdown.c(738):
> markdown_hook_check_config: markdown_conf found? true which is
> printed from an ap_log_error call in markdown_hook_check_config.
>
> However, I see no similar line for commonmark, which has a similar
> call in its commonmark_hook_check_config. There is no output for
> either in errors.log.

Ugh, typo, registered name of mod didn't match the ModEnabled in the config.

Gary

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org