Stream: shorthand
Topic: Passthrough pages
Josh Mandel (Aug 18 2020 at 22:35):
If I have an .html page that I want to pass through to the built IG unmodified (e.g., https://github.com/HL7/smart-app-launch/blob/master/spec/worked_example_id_token/index.html), is there a way to mange this in sushi's ig-data directory?
Josh Mandel (Aug 18 2020 at 22:36):
Maybe by putting it in "images" ?
Josh Mandel (Aug 18 2020 at 22:37):
I guess that does the trick (but definitely feels... unkosher).
Jose Costa Teixeira (Aug 18 2020 at 22:40):
If you put it in ig-data/input/pagecontent, doesn't that work?
Josh Mandel (Aug 18 2020 at 22:41):
It doesn't.
Jose Costa Teixeira (Aug 18 2020 at 22:41):
I think it should, then :) I am not aware of any other way, sorry.
Jose Costa Teixeira (Aug 18 2020 at 22:45):
There is a thread where I suggested the possibility to bring in existing IG content (e.g. in ig-data
) and that content will be merged with whatever sushi produces.
If that suggestion is accepted, then I think this would work correctly.
Jean Duteau (Aug 18 2020 at 22:46):
you could just put it in the input directory (not in the fsh/ig-data/input directory)
Jose Costa Teixeira (Aug 18 2020 at 22:49):
Didn't think of that, Thanks @Jean Duteau
Josh Mandel (Aug 18 2020 at 22:52):
Hmm, I don't otherwise have an input directory in version control, and I like to think of it as emphemeral, since sushi is generally writing/overwriting stuff there.
Sushi's .gitignore by default leave input
out of version control.
Josh Mandel (Aug 18 2020 at 22:52):
That said, I've been using sushi for all of 2h, so I may not have grokked best practices yet ;-)
Josh Mandel (Aug 18 2020 at 22:52):
On that subject, am I supposed to check files like like _genonce into version control?
Jean Duteau (Aug 18 2020 at 22:54):
yeah, that is the problem with my suggestion. if you're trying for an all-sushi IG, it breaks that. I check those in because I'm creating the repository for others to clone and run, so I check in my shell scripts. If you look at github.com/HL7/davinci-pas, you'll see what I check in. NOTE: I do check in an input directory, because I need the ignoreWarnings.txt file.
Josh Mandel (Aug 18 2020 at 22:55):
Thanks! (For the moment, I'm trying to do the least-friction thing that'll get me started porting the old SMART IG.)
Jean Duteau (Aug 18 2020 at 22:58):
i thought that SUSHI used to copy over directories in ig-data/input that it didn't know about without touching it, but I just tested and it doesn't do that. so putting it in ig-data/input/images is probably the only way right now
Nick Freiter (Aug 19 2020 at 10:53):
Jose Costa Teixeira said:
If you put it in ig-data/input/pagecontent, doesn't that work?
This should work, and in my quick testing it does seem to work. SUSHI does give a warning:
Files not in the supported file types (.md and .xml) were detected. These files will be copied over without any processing.
but that is intentional. So if this isn't working for you @Josh Mandel that would be a bug, so if you are able to share any more info about how you are getting an error we can try to reproduce and see what's going on.
Josh Mandel (Aug 19 2020 at 13:06):
Thanks. I will try to capture some details for debugging.
Josh Mandel (Aug 20 2020 at 18:20):
So here's a place where it's failing:
- https://github.com/HL7/smart-app-launch/blob/move-to-fsh/fsh/ig-data/input/pages/worked_example_test.html does not appear in the output
- https://github.com/HL7/smart-app-launch/blob/move-to-fsh/fsh/ig-data/input/images/worked_example_id_token.html does appear
Josh Mandel (Aug 20 2020 at 18:20):
(See output at https://build.fhir.org/ig/HL7/smart-app-launch/branches/move-to-fsh/)
Chris Moesel (Aug 20 2020 at 18:36):
Hi @Josh Mandel -- I cloned your repo, switched to your branch, and ran SUSHI. I confirm that @Nick Freiter stated above: It did copy over your HTML file. See screenshot:
image.png
Josh Mandel (Aug 20 2020 at 18:45):
How fun. Huh, and yet it's not at https://build.fhir.org/ig/HL7/smart-app-launch/branches/move-to-fsh/worked_example_test.html. I'll investigate more :)
Chris Moesel (Aug 20 2020 at 18:47):
I just ran it through the publisher and it seems the publisher is choking on it. Here's the message I got:
Chris Moesel (Aug 20 2020 at 18:48):
Error on line 6755 column 78
SXXP0003: Error reported by XML parser: The reference to entity "v" must end with the ';' delimiter.
Exception generating page /Users/cmoesel/dev/tmp/smart-app-launch/temp/pages/_includes/worked_example_test.html: org.xml.sax.SAXParseException; lineNumber: 6755; columnNumber: 78; The reference to entity "v" must end with the ';' delimiter. (00:29.0966)
Josh Mandel (Aug 20 2020 at 18:49):
OK --- so putting it in images
causes it to be a real passthrough, whereas putting it in pages
causes the publisher to try to parse it.
Chris Moesel (Aug 20 2020 at 18:55):
That seems to be the case, although the IG Template documentation seems to suggest otherwise (emphasis mine):
The processing of the content of the page folders will vary. Those .md and .xml files named to act as intro sections or notes sections will be injected into the base web pages for their respective resources. Other .md and .xml files will be processed and turned into HTML pages representing the narrative content for the IG. All other files will be copied to the output folder unchanged.
Chris Moesel (Aug 20 2020 at 18:56):
That said, further in the documentation, it calls out the specific folders and says:
- pages (for the markdown or XHTML page content)
- pagecontent (same purpose as pages - use whichever name you prefer)
So maybe the parenthetical statements there are meant to indicate that only markdown and XHTML should be placed there? @Lloyd McKenzie?
Grahame Grieve (Aug 20 2020 at 21:00):
it might be the template... Lloyd has added all sorts of extra smart stuff in there, and it hasn't been made robust by people hammering on it yet.
but why do you want invalid XML?
Jose Costa Teixeira (Aug 21 2020 at 03:44):
@Josh Mandel I missed that you said .html. Do you want html instead of xhtml?
Josh Mandel (Aug 21 2020 at 12:13):
I want HTML and indeed this particular HTML because it's generated from my Jupiter notebook, using a process I don't control, and it works in every browser I've tested :-)
Jose Costa Teixeira (Aug 21 2020 at 13:00):
ok but that html is not going to have the template header and footer, right? It's just a local file that you can point to. right?
Josh Mandel (Aug 21 2020 at 19:36):
Yes. I just want it to pass through the build process.
Eric Haas (Aug 22 2020 at 01:23):
Do you want the jupyter to to display like a jupyter file? You could export it as a as a markdown file.
..OH I just realized you probably downloaded as an html file... duh
Eric Haas (Aug 22 2020 at 01:24):
if you want it as a jupyter file then belongs in image folder and you can download from there
Eric Haas (Aug 22 2020 at 01:25):
Or just link to a Binder
Eric Haas (Aug 22 2020 at 01:26):
or a GIST which does a nice rendering of Jupyter files
Eric Haas (Aug 22 2020 at 01:29):
let me give it a shot...
Eric Haas (Aug 22 2020 at 02:35):
source folder for me is `fsh/ig-data/input/pagecontent/'
Sushi yells if the content is html ..( md or xml only!!!) and passes it through
the markdown is happy though! and both are passed through for the build...
to input/pagecontent/
running the build I see the markdwon file as a page
... but no page for the html :-( ( I noted this earlier in this chat:
here is what sushi created in the ig resource
page:
- nameUrl: index.html
title: Home
generation: markdown
- nameUrl: downloads.html
title: Downloads
generation: markdown
- nameUrl: guidance.html
title: Guidance
generation: markdown
- nameUrl: utils-md.html
title: Utils Md
generation: markdown
ignoring the html totally... EVEN IF you manually edit it and add to the ImplementationGuide.definition.page.page
- nameUrl: utils.html
title: Utils
generation: html
will error out with
Publishing Content Failed: Template based HTML file utils.html is missing source file utils.xml (01:13.0089)
because of this issue: when xml page in the ig resource page.generation code define it be "xml" not "html" which is how ig-pub is documented.
so for the input/pagecontent/file.xml is in ig resource as ...
- nameUrl: file.html
title: File
generation: html
which is confusing to have the file suffix xml and generation codes different...
trying xml is no better...
- nameUrl: utils.html
title: Utils
generation: xml
this fails to generate output silently...
see this chat....
Lloyd McKenzie (Aug 23 2020 at 18:03):
pagecontent is not passed through - it gets run through transforms and such. Content that is intended to be copied directly to output with no modifications should go in images.
Eric Haas (Aug 24 2020 at 17:15):
pagecontent is not passed through - it gets run through transforms and such.
yes but the issue is it cannot be just html - it has to be xthml(.xml) or md which is why the Jekyll example silently failed to load.
Last updated: Apr 12 2022 at 19:14 UTC