OpenMath / OpenMath.github.io

For the OpenMath.org website
https://openmath.github.io/
5 stars 10 forks source link

Add source links to XHTML rendering of CDs #33

Closed lars-hellstrom closed 7 years ago

lars-hellstrom commented 7 years ago

We are now entering an era where many CDs are going to have some kind of source which is distinct from the .ocd file (even though the .ocd file is still going to be the normative definition of the CD): there are MMT theories, (if memory serves) OMDoc, .tex documents using the openmathcd package, and (soonish) the DLMF. I'm not sure what the state of Lurch-edited CDs are with respect to this.

The XHTML renderings of CDs should have links to such sources (if available), just like they (if memory serves) historically could have links to companion .sts files (rendered and raw). There are a couple of cases:

  1. The source is a document, stored on openmath.org (presumably because the author contributed it at the same time as the .ocd file). This has two subcases, which may both be at hand, and thus warrant two links:
    1. The source is available as the source proper (preferred editing format).
    2. The source is available in rendered format (PDF, HTML, …)
  2. Like 1, but the source is housed elsewhere, the author only having provided a URL for it.
  3. The source is not just one document, but rather a collection of them; this is what I suspect would be the state of things with the DLMF. Ends up being not too different from case 2, but one should document a recommendation that what the URL points at should be some sort of persistent "landing page" focused at detailing what went into that particular CD, and then giving further links as required to find the source for the CD content.
kohlhase commented 7 years ago

I think that in the new "era" (if we manage to pull it off) we will have to seriously rethink the CD information system that helps people find CDs. I am not sure (read "I seriously doubt") that the current statically-generated XHTML with dynamic insets is the right architecture for that. Travis already needs 7 minutes for generation. Takethat 100x, then this will not work.

I am currently thinking of extending the MMT-based MathHub.info and its flexible build system to become a new-era CD information system (it has most of the parts already), but that will take some time. We should make due with what we have in the meantime, and update it so that it becomes usable for the CDs we currently have.

davidcarlisle commented 7 years ago

note that travis takes 7 minutes if you rebuild everything, less than a minute otherwise, the main reason it's slow is starting java every time, you can avoid that by writing the loop in java so you only compile the stylesheet once but it's not obvious how to mix that with a make based build that really wants to specify each file separately. For now I think it's OK.

Assuming that the site needs to go "live" at openmath.org before any completely new presentaion format is in place I think we should still look at what can be added/improved in the current html view. Adding links is easy enough but the question is where to put the information in the source to generate the link (and I just commented in issue #24 author information is similarly being lost) given that the input .ocd format has just been fixed again I don't think we can change that but we could use stylized CDComment within the ocd file, or use some *.data associated file with additional metadata that could be added to the html view. Most simply (but perhaps not in the OM structured data tradition) would be to allow foo.data to be a fragment of html that is simply inlined into the html view of the foo CD in the meta data section, with some optional heading, after status:

davidcarlisle commented 7 years ago

any http URL in a CDComment was already made into a link in the HTML view. in commit https://github.com/OpenMath/CDs/commit/a56c2dcdfbecc3c9620075edf2a5bba0cf2f0990 I added https as well.

I have added stylized comments to all the Official and experimental CDs pointing back to the CDs repository

<CDComment>
  Author: OpenMath Consortium
  SourceURL: https://github.com/OpenMath/CDs
</CDComment>

But any comment with something that looks like a link will be a link in the html view.

Currently the formatting is not ideal (just formatted as a <pre> because of the CDComment markup but if needed comments matching this form could be lifted up to the frontmatter in the HTML view, along with <CDDate> etc. but not today, However I think the SourceURL link in (for example) https://openmath.github.io/cd/Official/arith1.html is enough to close this issue?