URL Shortcuts

Steven J Zeil

Last modified: Jun 9, 2020
Contents:

Markdown treats text in square brackets followed by a URL in parenthese as a link: [example]``(http://www.cs.odu.edu/~zeil/).

CoWeM uses special forms of URL in Markdown links to provide for easier inter-document linking and to flag certain formatted data fields for special processing.

1 Special URLs for Navigation

1.1 doc: shortcuts

If the URL in a link is written as doc:_documentName_, it is treated as a shortcut to another document within the website.

A warning is issued while the website is being built if a doc: URL shortcut does not match any document or if it ambiguously matches more than one.

You can see multiple examples of doc: shortcuts in the examples in Preparing a Course Outline. You can add # specifiers to the end to link to particular sections of a document. For example doc:urlShortCuts#tbd-links would link directly to the next section of this document.

In conjunction with doc: shortcuts, if the entire text of the link is “TBD” (for “to Be Determined”), the generated link will actually contain the title of the linked document as specified in that document’s metadata.

For example, [TBD](doc:directories) would actually appear as the link: Directories and Files

1.3 Linking to External CoWeM Sites

It is possible to link to external CoWeM sites with an extension of the doc: URL scheme.

Ann number of external sites can be imported by adding commands of the form importing(_name_,_url_) to the course description in the root build.gradle file. For example,

// Top-level build.gradle for a course.

plugins {
   id 'edu.odu.cs.cowem.course' version '1.16'
}


course {
    courseName        = 'CS 350'     
    courseTitle       = 'Introduction to Software Engineering'
    semester          = 'Fall 2016'
    sem               = 'f16'             
    instructor        = 'Steven J Zeil'   
    email             = 'zeil@cs.odu.edu' 
    copyright         = '2016, Old Dominion Univ.'  
    homeURL           = '../../Directory/outline/index.html' 
    
    importing('faq', 'https://www.cs.odu.edu/~zeil/FAQs')
}


This indicates that we want to link to documents within the site at the indicated URL, referring to that site as “faq” for sort. We can then refer to a document by its name on that website, prefixing the name with “faq:”.

For example, we could link to the document “installingACompiler as doc:faq:installingACompiler or to a section inside that document as doc:faq:installingACompiler#installing-a-c-compiler-on-microsoft-windows.

1.4 graphics: and styles: shortcuts

If the URL in a link is written as graphics:fileName, it is treated as a shortcut to that file within the website’s main graphics/ directory. For example, I could insert the “home” navigation icon as <img src='graphics:home.png'/>:

Similarly, a styles:fileName URL is resolved as a link to the website’s main styles/ directory.

2 Special URLs for Dates

A handful of special URLs are used to flag dates and times in the course outline for special processing. These can be used anywhere, but their main purpose is to flag activity items in the course outline for export into calendars.

2.1 date:

A link with the URL date: declares a date or date-time combination. The text of the link should specify a date in ISO 8601 format: YYYY-MM-DDThh:mm:ss

The seconds may be omitted from the end of the time. The entire time (starting with the separating character ‘T’) may be omitted if only the date is desired.

These will be reformatted into more readable forms. Examples:

[2016-01-02T07:30](date:)
is reformatted as 01/02/2016, 7:30AM EST
[2016-01-03](date:)
is reformatted as 01/03/2016

2.2 due:

This is like date:, but has slightly different handling when imported into calendars. A date: with no time component is assumed to refer to the start of the day. A due: with no time component is assumed to refer to the end of the day.

[2016-01-02T07:30](due:)
is reformatted as 01/02/2016, 7:30AM EST
[2016-01-03](due:)
is reformatted as 01/03/2016

2.3 enddate:

A date: link can be immediately followed by a link with an enddate: URL to specify a range of dates and times.

[2016-01-02T07:30](date:) [2016-01-05T08:50](enddate:)
is reformatted as 01/02/2016, 7:30AM EST - 01/05/2016, 8:50AM EST
[2016-01-02](date:) [2016-01-05](enddate:)
is reformatted as 01/02/2016 - 01/05/2016
[2016-01-02T07:30](date:) [2016-01-02T08:50](enddate:)
is reformatted as 01/02/2016, 7:30AM EST - 8:50AM

No support is provided in CoWeM v1.0 for time zones. That may be added in later versions.