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

Remove now unnecessary files after migration away from Jekyll #214

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions doc/code-excerpts.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@ For more information about the `replace` argument syntax see

# Advanced features

## Embellished code excerpts

In some repos, code excerpts not only serve to associate a code block with its
originating source, but the processing instruction guides Jekyll plugins at site
compile time. The rendered code is displayed in an embellished bordered box with
an (optional) header (usually containing the originating file name and code
region name), as well as an interactive copy-code button.

Nothing extra needs to be added to the processing instructions (other than selected arguments like `title`, when desired). Generation of the adorning HTML is handled by Jekyll plugins like [markdown_with_code_excerpts.rb][].

## Code diffs

To make use of code diffs in a given page, add the following to the page's front matter (or archive the equivalent setting using `_config.yml` file defaults):
Expand Down
2 changes: 1 addition & 1 deletion doc/images.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Compressing

Compress/optimize all images uploaded to the site
to reduce site load time as well as Jekyll build time.
to reduce site load time as well as site build time.

[TODO: Include tool in site infrastructure for optimizing images]

Expand Down
41 changes: 0 additions & 41 deletions doc/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,4 @@ To use a specific `site-shared` resource, you'll generally create a symlink to
the desired resource file. In some cases, you'll need to adjust the site
`_config.yml`. Details are given below.

## Jekyll

We use the [Jekyll][] site generator, leaving most of its configuration options
at their [default settings][Default configuration],
including use of Kramdown as the Markdown processor
and [Rouge][] as the default syntax highlighter.

To see a list of the languages you can use with <code>```</code>, see
Rouge's [list of supported languages and lexer][languages].
The most common languages we use are `dart`, <code>console</code> (or its equivalent,
<code>terminal</code>), <code>nocode</code>, and <code>yaml</code>.

## Ruby gems and the bundler

Jekyll is written in Ruby, so we use the [bundler][] (the equivalent of Dart's
pub) to manage gems (the equivalent of pub packages). Each site's `Gemfile`
specifies the gems it uses, possibly constraining gem versions (similar to what
you'd do using a `pubspec.yaml` file). The bundler creates a `Gemfile.lock`
which (transitively) lists the gems and gem versions actually used for the site.

For optimal sharing of resources across sites, ensure that the sites' `Gemfile`s
are kept as in sync to the extent practical / possible.

## Jekyll plugins

The main third-party Jekyll plugins we use are the following:

- [jekyll-toc][] for auto-generation of page table of contents.

We share custom plugins across sites. These can be found under [src/_plugins][].
To use a shared plugin, create a symlink from the plugin in
`site-shared/src/_plugins` to the repo's `src/_plugins` folder.

[bundler]: https://bundler.io
[Default configuration]: https://jekyllrb.com/docs/configuration/default/
[git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
[Jekyll]: https://jekyllrb.com
[jekyll-toc]: https://github.com/toshimaru/jekyll-toc
[languages]: https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers
[Rouge]: https://github.com/rouge-ruby/rouge
[src/_assets]: https://github.com/dart-lang/site-shared/tree/main/src/_assets
[src/_plugins]: https://github.com/dart-lang/site-shared/tree/main/src/_plugins
38 changes: 6 additions & 32 deletions doc/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,13 @@ meaning you can write using [GitHub Flavored Markdown][].

## Code blocks

There are two ways to document code blocks on our sites:
Use standard markdown syntax for fenced code blocks.

1. Use standard markdown syntax for fenced code like this:

````markdown
```dart
class C { ... }
```
````

1. Use the [prettify][] Jekyll block tag, supported via a custom plugin
designed for use on our sites.
Only use if you need code highlighting and the snippet
is not a code-excerpt.

```markdown
{% prettify dart %}
void main() { ... }
{% endprettify %}
```

### **PREFER** using ``` fenced markdown for **code blocks**

Standard markdown syntax is recognized by many IDEs as well as online editors
and viewers like those available on GitHub. These tools offer convenient syntax
highlighting and more. Markdown syntax can be used in site pages as well as API
documentation.

For these reasons, prefer standard markdown code-block syntax over use of the
Jekyll prettify block tag.

Use the `prettify` block tag if you need support for code highlighting, and your
site isn't using the [markdown_with_code_excerpts.rb][] plugin.
````markdown
```dart
class C { ... }
```
````

## **AVOID** using HTML when markdown syntax will do

Expand Down
32 changes: 12 additions & 20 deletions doc/writing-for-dart-and-flutter-websites.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ as you develop content for Dart and Flutter websites.
Contents of this page:
* [Semantic line breaks (<=80 chars)](#semantic-line-breaks)
* [URLs](#urls)
* [Images](#images)
* [Code](#code)
* [Markdown and HTML](#markdown-and-html)
* [Top matter (YAML)](#top-matter-yaml)
Expand Down Expand Up @@ -76,10 +75,10 @@ Follow these rules when creating links:

* If you're editing an `index.html` or `index.md` page,
don't use relative links. Instead, use links that **start** with `/`.
Otherwise (because we omit trailing `/`s) links go one directory too high.
Otherwise, (because we omit trailing `/`s) links go one directory too high.
For example, a `/tools` page should link to `/tools/sdk`, not to `sdk`.

* Use jekyll variables if they exist; define new ones if necessary.
* Use liquid variables if they exist; define new ones if necessary.
You can find sitewide variables in `/_config.yml`.
For example, the [site-www `_config.yml` file][] defines variables like
`dartpad`, `flutter`, and `dart_api`, so site-www has URLs like
Expand Down Expand Up @@ -167,8 +166,8 @@ also keep in mind [Whitespace control][]
to allow for proper formatting of the generate HTML.

[liquid]: https://shopify.github.io/liquid/
[includes]: https://jekyllrb.com/docs/liquid/tags/#includes
[filters]: https://jekyllrb.com/docs/liquid/filters
[includes]: https://liquidjs.com/tags/include.html
[filters]: https://www.11ty.dev/docs/languages/liquid/#filters
[raw]: https://shopify.github.io/liquid/tags/template/#raw
[Whitespace control]: https://shopify.github.io/liquid/basics/whitespace/

Expand Down Expand Up @@ -234,21 +233,14 @@ and **category**.
## Asides

To add notes, tips, warnings, and other asides
use the following custom-defined Liquid tags:
use the following custom Markdown syntax.

```
{{site.alert.tip}}
Tip text goes here.
{{site.alert.end}}
...
{{site.alert.important}}
Important text goes here.
{{site.alert.end}}
```

All text within an aside should be consistently indented 2 spaces.
:::tip
Tip text goes here.
:::

You can see the full list of aside/alert types
in your site repo's `_config.yml` file.
For example, search for `alert:` in
[Flutter's `_config.yml` file](https://github.com/flutter/website/blob/main/_config.yml).
:::important
Important text goes here.
:::
```
18 changes: 9 additions & 9 deletions packages/code_excerpt_updater/test_data/src/no_change/diff.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Diff tests of code blocks in Jekyll `diff` tags
## Diff tests of code blocks in Markdown `diff` tags

## Basic

<?code-excerpt "0-base/basic.dart" diff-with="1-step/basic.dart"?>
{% diff %}
```diff
--- 0-base/basic.dart
+++ 1-step/basic.dart
@@ -1,4 +1,4 @@
Expand All @@ -12,12 +12,12 @@
var _scope = 'world';

void main() => print('$_greeting $_scope');
{% enddiff %}
```

### Files with docregion tags

<?code-excerpt "0-base/docregion.dart" diff-with="1-step/docregion.dart"?>
{% diff %}
```diff
--- 0-base/docregion.dart
+++ 1-step/docregion.dart
@@ -1,4 +1,4 @@
Expand All @@ -32,23 +32,23 @@
/// hunks
-void main() => print('$_greeting $_scope');
+void main() => print('$_greeting $_scope!');
{% enddiff %}
```

### Diff region

<?code-excerpt "0-base/docregion.dart (main)" diff-with="1-step/docregion.dart"?>
{% diff %}
```diff
--- 0-base/docregion.dart (main)
+++ 1-step/docregion.dart (main)
@@ -1 +1 @@
-void main() => print('$_greeting $_scope');
+void main() => print('$_greeting $_scope!');
{% enddiff %}
```

### Files with docregion tags and diff-u argument

<?code-excerpt "0-base/docregion.dart" diff-with="1-step/docregion.dart" diff-u="4"?>
{% diff %}
```diff
--- 0-base/docregion.dart
+++ 1-step/docregion.dart
@@ -1,5 +1,5 @@
Expand All @@ -65,7 +65,7 @@
/// hunks
-void main() => print('$_greeting $_scope');
+void main() => print('$_greeting $_scope!');
{% enddiff %}
```

## Bash path-brace syntax for diffs

Expand Down
1 change: 0 additions & 1 deletion src/_assets/vendor/code-prettify/_prettify.scss

This file was deleted.

Loading
Loading