Skip to main content

The PreTeXt Guide

Subsection 4.28.3 Visual URLs

By a visual URL we mean a version of a URL that is simpler than the “real” URL, but that provides enough information that a reader can type the URL into some other device with a minimum of effort, and with success. Consider that your project may someday be a print (hardcopy) book, or that your project will be converted to braille for a blind reader. These are some ideas about making a URL simpler. We welcome more ideas.
  • Remove standard/default protocols like http:// and https:// which most browsers will furnish in their absence.
  • Sites like StackExchange 4  list posts with a long identifying number, followed by something that looks like the title. In practice, the number is enough.
  • Experiment with dropping a trailing slash—they are frequently unnecessary.
  • Often a leading www. in a domain name is not necessary.
  • Try providing just a domain name in place of a top-level landing page, it will often redirect to a longer URL.
  • You could use a URL shortener 5 , though some thought should be given to its longevity 6 . Will you remember where your short URLs point once they are no longer functional. Safer to have your long URLs in an @href in your source, and use PreTeXt to make them friendlier.

Best Practice 4.28.3.1. Craft URLs Carefully.

Your writing will be smoother, and easier on your readers, if you do not interrupt a sentence with a long URL, unless somehow it is really of interest and relevant right there. So provide content (the “clickable” text) when you use the <url> element (rather than an empty <url/>). This obligates you to provide a @visual attribute, which feels a little like a tedious exercise. But this will be very welcome to some of your readers, those who are unable or prefer not to use electronic formats. Just above (Subsection 4.28.3), we provide suggestions for crafting these to be more pleasing, but still useful, versions of URLs.
stackexchange.com
https://w.wiki/4QA
https://w.wiki/4eEM