Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equivalent of <pre> tag #21

Closed
kcrisman opened this issue Jan 16, 2015 · 9 comments
Closed

Equivalent of <pre> tag #21

kcrisman opened this issue Jan 16, 2015 · 9 comments

Comments

@kcrisman
Copy link
Contributor

For now, workaround is

        <program>
            <input>
            stuff
            </input>
        </program>

at least I think that should work, but maybe that's not ideal.

@rbeezer
Copy link
Collaborator

rbeezer commented Jan 16, 2015

Right. <c> works for small inline snippets, but I really need something for large blocks (w/ carriage returns) that is not as cumbersome as <program>, which is meant for programming languages listings. I do think your workaround is the best suggestion now.

What do you think of <code>, which would get sanitized like <input> does? (Preserve line breaks, preserve indentation, etc). Or maybe just recycle <pre>?

@davidfarmer
Copy link
Contributor

The other day I learned of the term "tag abuse", which is when you use
a tag merely for the side-effect of having its contents appear with the
desired visual appearance.

Since (presumably!) should contain actual code, it would be bad
to have the as the generic preformatting tag. Since we need
a generic preformatting tag, it makes sense to recycle

.

I see an analogy with and .

What to do before we have both a and a

 tag?  I think the
suggestion of using is a good one, because it is
obviously tag abuse, intended to be temporary as we develop the standards,
and can be fixed later.

On Fri, 16 Jan 2015, Rob Beezer wrote:

Right. works for small inline snippets, but I really need something for large blocks (w/ carriage returns) that is
not as cumbersome as , which is meant for programming languages listings. I do think your workaround is the
best suggestion now.

What do you think of , which would get sanitized like does? (Preserve line breaks, preserve indentation,
etc). Or maybe just recycle

?


Reply to this email directly or view it on GitHub.[AAM6LBU0nZfv21ZAkk01DTtK1aRqa3vhks5niN32gaJpZM4DTL9R.gif]

@rbeezer
Copy link
Collaborator

rbeezer commented Jan 16, 2015

On 16/01/2015 14:20, davidfarmer wrote:

I see an analogy with and .

So if I understand right, it would be tag abuse if I were to use on
a defined term? Because I am simply using the tag to gain the visual formatting
that I think a defined term should have? So we have to prevent tag
abuse? And need

 to prevent more.

Is it abusive to have an tag in the first place? I would argue not, but
on first reading I thought this might be what you meant by "use
a tag merely for the side-effect of having its contents appear with the
desired visual appearance."

Rob

@davidfarmer
Copy link
Contributor

Yes to your first question, and that is probably the most
common example of tag abuse. (Or maybe it is for .)
We need because sometimes emphasis is just emphasis.

But we need to train people to use the semantic markup when it is
available, and alert us to cases where we may need a new tag.

Let's hope nobody thinks to suggest , , and <C++>
tags in place of the generic tag! (You may want an
optional language="python" attribute to .)

On Fri, 16 Jan 2015, Rob Beezer wrote:

On 16/01/2015 14:20, davidfarmer wrote:

I see an analogy with and .

So if I understand right, it would be tag abuse if I were to use on
a defined term? Because I am simply using the tag to gain the visual formatting
that I think a defined term should have? So we have to prevent tag
abuse? And need

 to prevent more.

Is it abusive to have an tag in the first place? I would argue not, but
on first reading I thought this might be what you meant by "use
a tag merely for the side-effect of having its contents appear with the
desired visual appearance."

Rob


Reply to this email directly or view it on GitHub.[AAM6LCk4Fhp7LprwW9PNpjKRUk-hAEK9ks5niPzmgaJpZM4DTL9R.gif]

@rbeezer
Copy link
Collaborator

rbeezer commented Jan 16, 2015

supports a plethora of language="".

LaTeX output uses the listings package and HTML uses Google's CodePrettifier,
both to achieve syntax highlighting. The and have obvious
uses. So the intent is that language-specific code goes in .

Maybe should be like a block-level version of the inline . That would
be my first thought. And

 would be more generic.

I am giving my students here at AIMS lots of "stuff" they can cut/paste out of
an assignment into Sage worksheets. Mostly entries of semi-big matrices (list
of lists of numbers). Not program statements, perhaps code, more
computer-specific than just

.

Suppose you provided a small data set to a reader. 20 rows, 6 numbers to a row.
Formatted so it could be cut/paste without loss (eg, minus signs are not some
Unicode dash, as sometimes happens in PDFs). What would you wrap that in?

Rob

On 16/01/2015 14:53, davidfarmer wrote:

Yes to your first question, and that is probably the most
common example of tag abuse. (Or maybe it is for .)
We need because sometimes emphasis is just emphasis.

But we need to train people to use the semantic markup when it is
available, and alert us to cases where we may need a new tag.

Let's hope nobody thinks to suggest , , and <C++>
tags in place of the generic tag! (You may want an
optional language="python" attribute to .)

On Fri, 16 Jan 2015, Rob Beezer wrote:

On 16/01/2015 14:20, davidfarmer wrote:

I see an analogy with and .

So if I understand right, it would be tag abuse if I were to use on
a defined term? Because I am simply using the tag to gain the visual formatting
that I think a defined term should have? So we have to prevent tag
abuse? And need

 to prevent more.

Is it abusive to have an tag in the first place? I would argue not, but
on first reading I thought this might be what you meant by "use
a tag merely for the side-effect of having its contents appear with the
desired visual appearance."

Rob


Reply to this email directly or view it on
GitHub.[AAM6LCk4Fhp7LprwW9PNpjKRUk-hAEK9ks5niPzmgaJpZM4DTL9R.gif]


Reply to this email directly or view it on GitHub
https://github.com/rbeezer/mathbook/issues/21#issuecomment-70249592.

@kcrisman
Copy link
Contributor Author

Maybe should replace ; not all code is an actual program. For instance, it could be a non-functioning snippet.

@davidfarmer
Copy link
Contributor

I think we need to take this discussion to the mailing list so more people can comment.
A particular concern is missed use cases.

@kcrisman
Copy link
Contributor Author

If you do have that discussion, is there a tag for "comment" as well? Perhaps something that would drop down a knowl ... that is actually what I have been using the pre tag for.

@rbeezer
Copy link
Collaborator

rbeezer commented Jan 31, 2015

I have implemeted and pushed a <pre> element. I really needed it the past three weeks at AIMS so was anxious to put it in place.

KDC - I'm uncertain about your request for a "comment" tag. Comment on something in particular, or would the remark tag be too heavy (gets a number)? Remarks will be knowlizable eventually. I'm thinking maybe we already had that discussion? Anyway, please open a new issue for "comment" as I am going to close this one now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants