PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

TeXShop HTML #1102

Closed twjudson closed 4 years ago

twjudson commented 5 years ago

The current TeXShop engine has the following code:

!/bin/bash

OUTFILE="basename $1" OUTFILE="${OUTFILE%.*}.html" xsltproc --xinclude $HOME/Library/TeXShop/bin/xsl/mathbook-html.xsl "$1" 1>&2 open "$OUTFILE" &

This will compile the HTML for PreTeXt in TeXShop and open the HTML in Safari provided the XML ID in the document matches the file name. E.g.,

requires the file name to be minimal.xml. However, sample-article.xml contains the line
. The file derivatives.html will be created but will not open automatically. I am not sure what the fix is.

kcrisman commented 5 years ago

requires the file name to be minimal.xml. However, sample-article.xml contains the line . The file derivatives.html will be created but will not open automatically. I am not sure what the fix is.

Is some text missing here?

Alex-Jordan commented 5 years ago

@twjudson may be able to edit his own post, and protect some tag with backticks. What I suspect happened here is that there is an element like <book xml:id="foo"> or something, unprotected.

rbeezer commented 5 years ago

The missing stuff is not crtical, methinks. I'm pretty sure I know what it says.

rbeezer commented 5 years ago

I think we should be always building an index.html, even if it is a verbatim copy of another file with a "nice" name.

Generally, out-of-the-box behaviour should produce an index.html. Though not always as @twjudson observes.

So where I am going is: maybe the last line of the engine should read

open index.html &

and then the necessary changes will ensure that always does the right thing.

kcrisman commented 5 years ago

I think we should be always building an index.html, even if it is a verbatim copy of another file with a "nice" name.

Generally, out-of-the-box behaviour should produce an index.html. Though not always as @twjudson observes.

OT: I thought that we explicitly moved away from this model quite a while ago? Currently I find I have to create my own. Or at least it isn't created by xsltproc ... mathbook-html.xsl ...

mitchkeller commented 5 years ago

I would support always creating index.html as a copy of the main HTML file. (I'd prefer a symlink, but that might be problematic on Windows.)

I would suggest that the TeXShop build script look to see if Firefox is installed and do open -a Firefox index.html & if Firefox is available and otherwise default to just open index.html &. That will allow those experimenting with PreTeXt via TeXShop to continue using their default browsers but also ensure that their PreTeXt HTML is opened in a browser that will show non-empty knowls when viewing HTML stored locally.

twjudson commented 5 years ago

If we decide to always build index.html for any PreTeXt document (and I see good arguments for this), I think that we can easily adjust TeXShop. The default browser for TeXShop is Safari, but I don’t think that it would be difficult to change it to Firefox or Chrome.

Tom

On Jun 24, 2019, at 5:08 PM, Mitchel T. Keller notifications@github.com<mailto:notifications@github.com> wrote:

I would support always creating index.html as a copy of the main HTML file. (I'd prefer a symlink, but that might be problematic on Windows.)

I would suggest that the TeXShop build script look to see if Firefox is installed and do open -a Firefox index.html & if Firefox is available and otherwise default to just open index.html &. That will allow those experimenting with PreTeXt via TeXShop to continue using their default browsers but also ensure that their PreTeXt HTML is opened in a browser that will show non-empty knowls when viewing HTML stored locally.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_rbeezer_mathbook_issues_1102-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DABN3O24E6SNBOGAEV5BTX5TP4DPQTA5CNFSM4H2S6RI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYNHYUA-23issuecomment-2D505052240&d=DwMCaQ&c=2X_btuPRWkGwRX26NHIotzR6MNUgJAbf6yNNV5-qTbU&r=BQmZUphR5rjzEsIGWo4gOhHhb8A_MVZPtDOMQxdFlh8&m=k19X_2sbx9lN4uSehbw4NMZg8i1N4bluwRZB6HFS33Q&s=ChGCrJmDo0ylgj6NbFSkiiI3sl1MnoMs21CKMW_rNis&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABN3O2YIFS7AIBYQJWFKYFDP4DPQTANCNFSM4H2S6RIQ&d=DwMCaQ&c=2X_btuPRWkGwRX26NHIotzR6MNUgJAbf6yNNV5-qTbU&r=BQmZUphR5rjzEsIGWo4gOhHhb8A_MVZPtDOMQxdFlh8&m=k19X_2sbx9lN4uSehbw4NMZg8i1N4bluwRZB6HFS33Q&s=-UMUzkvrBAPEWXH3eXaANzyQT02t53-gjN9X8aAGs-g&e=.

rbeezer commented 4 years ago

I think everything here is squared away. I can't find teh relevant commit though, at the moment.