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

Minimize HTML vis comments #507

Open
amir-zeldes opened this issue Mar 13, 2016 · 0 comments
Open

Minimize HTML vis comments #507

amir-zeldes opened this issue Mar 13, 2016 · 0 comments

Comments

@amir-zeldes
Copy link
Collaborator

Currently the HTML Vis produces a lot of code because of span beginning/end comments. These are necessary in part in order to prevent automatic space rendering between HTML elements: a CSS hack described here was used by making comments that contain a line break, preventing forced spaces between rendered elements:

https://css-tricks.com/fighting-the-space-between-inline-block-elements/

The problem is that the resulting HTML can get fairly large, which is wasteful when ingesting large amounts of HTML, for example in data.copticscriptorium.org, which fetches hundreds of HTML visualizers from ANNIS.

Therefore it would be good to:

  1. Make the HTML comments smaller in general: instead of comments like

    <!-- end of "norm" -->
    

    We could just use 'e' and 's' for start and end:

    <!-- e -->
    

    This is less useful for debugging, but fine for a production server (users never see these)

  2. It would be good to make this behavior paramterizable via a mappings parameter. Three modes could be used: comments:{verbose;minimal;none}

  • Verbose would be the old comments ('end of norm')
  • Minimal would be just 'e' and 's'
  • None would be no comments, for visualizers that don't need the space hack described above.

This would reduce bandwidth, memory load and potentially readability of the generated HTML, at least in simple scenarios.

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

No branches or pull requests

1 participant