Skip to content

Commit

Permalink
Add "edit this page" buttons (#11)
Browse files Browse the repository at this point in the history
* custom edit content button template

* script template to add buttons

* script for each page

* all except resources/*.md

* resources

* Refine README based on new editing feature

* edit readme

* remove pencil.svg

* add back page that was deleted

* update

* remove button and reconfigure icon

* change icon

* patch links

* add .pencil-link class

* update button csss
  • Loading branch information
scott christian mccallum committed Jun 13, 2022
1 parent a0088f9 commit fce7d30
Show file tree
Hide file tree
Showing 57 changed files with 571 additions and 271 deletions.
46 changes: 2 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,9 @@ This site was built using [MkDocs](https://www.mkdocs.org/), a static site gener

## Editing site

To propose a feature, content addition, or UI/UX improvement, open an [issue](https://github.com/MobilityData/gtfs.org/issues/new) or [pull request](https://github.com/MobilityData/gtfs.org/pulls) on this repository. To edit site content, see instructions below.
To propose a feature, content addition, or UI/UX improvement, open an [issue](https://github.com/MobilityData/gtfs.org/issues/new) or [pull request](https://github.com/MobilityData/gtfs.org/pulls) on this repository.

## Editing site content

The GTFS Documentation Platform is based on open source content pulled from various repositories. To propose edits to content, make an issue or pull request in the respective source-of-truth repository found in the table below.

### Sources of truth & licenses

| gtfs.org | Source of truth | License |
| - | - | - |
| / | https://github.com/MobilityData/gtfs.org/blob/main/docs/index.md | CC BY 3.0 |
| /background/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/background.md | CC BY 3.0 |
| /schedule/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/schedule/index.md | CC BY 3.0 |
| /schedule/reference/ | https://github.com/google/transit/blob/master/gtfs/spec/en/reference.md | Apache License 2.0 |
| /schedule/best-practices/ | https://github.com/MobilityData/GTFS_Schedule_Best-Practices | CC BY 3.0 |
| /schedule/examples/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/schedule/examples/index.md | CC BY 3.0 |
| /schedule/example-feed/ | https://github.com/google/transit/blob/master/gtfs/spec/en/examples/README.md | Apache License 2.0 |
| /schedule/data-examples/ | https://github.com/google/transit/blob/master/gtfs/spec/en/examples/data-examples.md | Apache License 2.0 |
| /schedule/changes/ | https://github.com/google/transit/blob/master/gtfs/CHANGES.md | Apache License 2.0|
| /schedule/changes/process | https://github.com/google/transit/blob/master/gtfs/CHANGES.md | Apache License 2.0 |
| /schedule/changes/guiding-principles | https://github.com/google/transit/blob/master/gtfs/CHANGES.md | Apache License 2.0 |
| /schedule/changes/revision-history | https://github.com/google/transit/blob/master/gtfs/CHANGES.md | Apache License 2.0 |
| /realtime/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/README.md | Apache License 2.0 |
| /realtime/reference/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/reference.md | Apache License 2.0 |
| /realtime/proto/ | https://github.com/google/transit/blob/master/gtfs-realtime/proto/gtfs-realtime.proto | Apache License 2.0 |
| /realtime/best-practices/ | https://github.com/MobilityData/GTFS_realtime_Best-Practices | CC BY 3.0 |
| /realtime/feed-entities/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/feed-entities.md | Apache License 2.0 |
| /realtime/trip-updates/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/trip-updates.md | Apache License 2.0 |
| /realtime/service-alerts/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/service-alerts.md | Apache License 2.0 |
| /realtime/vehicle-positions/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/vehicle-positions.md | Apache License 2.0 |
| /realtime/examples/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/realtime/examples/index.md | CC BY 3.0 |
| /realtime/feed-examples/ | https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/examples | Apache License 2.0 |
| /realtime/language-bindings/*/ | https://github.com/MobilityData/gtfs-realtime-bindings | Apache License 2.0 |
| /realtime/changes/ | https://github.com/google/transit/blob/master/gtfs-realtime/CHANGES.md | Apache License 2.0 |
| /realtime/process/ | https://github.com/google/transit/blob/master/gtfs-realtime/CHANGES.md | Apache License 2.0 |
| /realtime/guiding-principles/ | https://github.com/google/transit/blob/master/gtfs-realtime/CHANGES.md | Apache License 2.0 |
| /realtime/revision-history/ | https://github.com/google/transit/blob/master/gtfs-realtime/CHANGES.md | Apache License 2.0 |
| /realtime/extensions/ | https://github.com/google/transit/blob/master/gtfs-realtime/CHANGES.md | Apache License 2.0 |
| /resources/*/ | https://github.com/CUTR-at-USF/awesome-transit/blob/master/README.md | CC0 1.0 Universal |
| /extensions/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/extensions.md | CC BY 3.0 |
| /about/ | https://github.com/MobilityData/gtfs.org/blob/main/docs/about.md | CC BY 3.0 |
To edit site content, click on the pencil icon on the top right corner of the webpage to find the source-of-truth document. 📝

## Building the site locally

Expand All @@ -57,10 +19,6 @@ The GTFS Documentation Platform is based on open source content pulled from vari
1. To run the site locally: `mkdocs serve`
1. To deploy the site to GitHub Pages: `mkdocs gh-deploy`

## Updating site structure

If a [source of truth](#source-of-truth-licenses) is specified, the site content is pulled, cleaned programatically, and given a directory destination in the repository. If a source of truth is unspecified, the content lives in this repository. The site structure is manually built in `mkdocs.yml` under `nav: `.

## License

Except as otherwise noted, the content of this site is licensed under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
Expand Down
6 changes: 5 additions & 1 deletion docs/about.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/MobilityData/gtfs.org/edit/main/docs/about.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# About

GTFS.org is maintained by [MobilityData](https://mobilitydata.org/), a Canadian non-profit that aims to broaden adoption and increase the functionality of the GTFS & GBFS data formats. Thank you to [Andrew Byrd](https://www.linkedin.com/in/byrdandrew) for purchasing and lending use of the gtfs.org domain name and providing leadership for the GTFS community.
Expand All @@ -23,4 +27,4 @@ To propose a feature, content addition, or UI/UX improvement, open an [issue](ht

## License

Except as otherwise noted, the content of this site is licensed under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
Except as otherwise noted, the content of this site is licensed under the [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
15 changes: 13 additions & 2 deletions docs/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,21 @@ table.example {
font-size: 0.61rem;
}

/* hide edit content button */
/* hide default edit content button */
.md-content__button {
display: none;
}
/* custom edit content button */
.pencil {
height: 1.5em !important;
fill: #ADADAD;
transition: 100ms ease-in-out;
position: relative;
float: right;
}
.pencil:hover {
fill: #4386FF;
}

/* side nav style */
.md-nav__list {
Expand Down Expand Up @@ -165,7 +176,7 @@ c {
}

/* external link icon */
.md-content a[href^="https://"]:not(.img) {
.md-content a[href^="https://"]:not(.img, .pencil-link) {
background: url(../external.svg) center right no-repeat;
padding-right: 13px;
background-size: 0.65em;
Expand Down
6 changes: 5 additions & 1 deletion docs/background.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/MobilityData/gtfs.org/edit/main/docs/background.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# Background

TriMet in Portland, Oregon, along with Google, was one of the first public agencies to try and tackle the problem of online transit trip planners through the use of open datasets that are shared with the general public ([How Google and Portland’s TriMet Set the Standard for Open Transit Data in Streetsblog SF](https://sf.streetsblog.org/2010/01/05/how-google-and-portlands-trimet-set-the-standard-for-open-transit-data/){target=_blank}). TriMet worked with Google to format their transit data into an easily maintainable and consumable format that could be imported into Google Maps. This transit data format was originally known as the Google Transit Feed Specification (GTFS).
Expand All @@ -6,4 +10,4 @@ As a result of developer innovation, GTFS data is now being used by a variety of

Among public transportation data formats, GTFS stands out because it was conceived to meet specific, practical needs in communicating service information to passengers, not as an exhaustive vocabulary for managing operational details. It is designed to be relatively simple to create and read for both people and machines. Even organizations that work with highly detailed data internally using standards like [NeTEx](https://netex-cen.eu/){target=_blank} find GTFS useful as a way to publish data for wider consumption in consumer applications.

For further background on the origins of GTFS, see [Pioneering Open Data Standards: The GTFS Story](https://beyondtransparency.org/chapters/part-2/pioneering-open-data-standards-the-gtfs-story/){target=_blank}.
For further background on the origins of GTFS, see [Pioneering Open Data Standards: The GTFS Story](https://beyondtransparency.org/chapters/part-2/pioneering-open-data-standards-the-gtfs-story/){target=_blank}.
6 changes: 5 additions & 1 deletion docs/extensions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/MobilityData/gtfs.org/edit/main/docs/extensions.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# Extensions

GTFS is a community driven data format. Users can propose and vote on changes. For detailed information see the [GTFS Schedule](../schedule/process) and [GTFS Realtime](../realtime/process) amendment process.
Expand All @@ -9,4 +13,4 @@ Extension proposals can be found in the following places:
- MobilityData maintains a [portal with a list of GTFS extension proposals](https://bit.ly/gtfs-extensions). The roadmap is based on their members' prioritization. You can contribute ideas or extensions via the portal.
- TransitWiki.org contains a [list GTFS extension projects](https://www.transitwiki.org/TransitWiki/index.php/General_Transit_Feed_Specification#GTFS_Extensions).

For more information, contact [specifications@mobilitydata.org](mailto:specifications@mobilitydata.org)
For more information, contact [specifications@mobilitydata.org](mailto:specifications@mobilitydata.org)
8 changes: 6 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# GTFS: Making Public Transit Data Universally Accessible
<a class="pencil-link" href="https://github.com/MobilityData/gtfs.org/edit/main/docs/index.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# GTFS: Making Public Transit Data Universally Accessible

The General Transit Feed Specification (GTFS) is a data specification that allows public transit agencies to publish their transit data in a format that can be consumed by a [wide variety of software applications](resources/apps). Today, the GTFS data format is used by thousands of public transport providers.

Expand All @@ -8,4 +12,4 @@ GTFS is split into a [schedule component](schedule) that contains schedule, fare

<br><div class="landing-page">
<a class="button" href="schedule">GTFS Schedule</a><a class="button" href="realtime">GTFS Realtime</a><a class="button" href="resources">Resources</a><a class="button" href="extensions">Extensions</a>
</div>
</div>
6 changes: 4 additions & 2 deletions docs/realtime/best-practices.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/MobilityData/GTFS_Realtime_Best-Practices/tree/master/en" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# GTFS Realtime Best Practices

## Introduction
Expand Down Expand Up @@ -193,5 +197,3 @@ GTFS applications and practices evolve, and so this document may need to be amen
Please link here in order to provide feed producers with guidance for correct formation of GTFS Realtime data. Each individual recommendation has an anchor link. Click the recommendation to get the URL for the in-page anchor link.

If a GTFS Realtime-consuming application makes requirements or recommendations for GTFS Realtime data practices that are not described here, it is recommended to publish a document with those requirements or recommendations to supplement these common best practices.


6 changes: 5 additions & 1 deletion docs/realtime/changes/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/google/transit/edit/master/gtfs-realtime/CHANGES.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# GTFS Realtime Changes

The GTFS Realtime Specification is not set in stone. Instead, it is an open specification developed and maintained by the community of transit agencies, developers, and other stakeholders who use GTFS Realtime. It is expected that this community of producers and consumers of GTFS Realtime data will have proposals for extending the spec to enable new capabilities. To help manage that process, the following procedures and guidelines have been established.
Expand All @@ -6,4 +10,4 @@ The official specification, reference and documentation are written in English.

<br><div class="landing-page">
<a class="button" href="../process">Specification Amendment Process</a><a class="button" href="../guiding-principles">Guiding Principles</a><a class="button" href="../revision-history">Revision History</a><a class="button" href="../extensions">Realtime Extensions</a>
</div>
</div>
4 changes: 4 additions & 0 deletions docs/realtime/extensions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/google/transit/edit/master/gtfs-realtime/CHANGES.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# Extensions
To allow producers to add custom information to a GTFS Realtime feed, we will take advantage of the [Extensions feature of Protocol Buffers](https://developers.google.com/protocol-buffers/docs/proto#extensions). Extensions allow us to define a namespace in a Protocol Buffer message where third-party developers can define additional fields without the need to modify the original proto definition.

Expand Down
4 changes: 4 additions & 0 deletions docs/realtime/feed-entities/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/google/transit/edit/master/gtfs-realtime/spec/en/feed-entities.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# Feed Entities

GTFS Realtime supports three distinct types of realtime data, that can be
Expand Down
4 changes: 4 additions & 0 deletions docs/realtime/feed-entities/service-alerts.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<a class="pencil-link" href="https://github.com/google/transit/edit/master/gtfs-realtime/spec/en/service-alerts.md" title="Edit this page" target="_blank">
<svg class="pencil" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20H6V4h7v5h5v3.1l2-2V8l-6-6H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h4v-2m10.2-7c.1 0 .3.1.4.2l1.3 1.3c.2.2.2.6 0 .8l-1 1-2.1-2.1 1-1c.1-.1.2-.2.4-.2m0 3.9L14.1 23H12v-2.1l6.1-6.1 2.1 2.1Z"></path></svg>
</a>

# Service Alerts

Service alerts allow you to provide updates whenever there is disruption on the network. Delays and cancellations of individual trips should usually be communicated using [Trip updates](trip-updates.md).
Expand Down
Loading

0 comments on commit fce7d30

Please sign in to comment.