From ce10aae9f8cd2edc9ead2628da2c3f620617f92a Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Thu, 15 Aug 2024 20:19:40 +0200 Subject: [PATCH 01/10] Next version --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b446f55c3..dd9e84c39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 0.20.0 (unreleased) + ## 0.19.2 (2024-08-15) - Fix some of YAML date parsing From 00981192debeeb57ef8c753750490caaaf404730 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Mon, 26 Aug 2024 14:51:17 +0530 Subject: [PATCH 02/10] exclude paginated pages in sitemap (#2555) This fixes #2527. --- components/config/src/config/mod.rs | 18 ++++++++++++++++++ components/site/src/sitemap.rs | 12 +++++++----- .../getting-started/configuration.md | 3 +++ .../documentation/templates/pagination.md | 6 ++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/components/config/src/config/mod.rs b/components/config/src/config/mod.rs index 88d949fc2..a1f1cfaf4 100644 --- a/components/config/src/config/mod.rs +++ b/components/config/src/config/mod.rs @@ -29,6 +29,13 @@ pub enum Mode { Check, } +#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum ExcludePaginatedPagesInSitemap { + None, + All, +} + #[derive(Clone, Debug, Deserialize)] #[serde(default, deny_unknown_fields)] pub struct Config { @@ -102,6 +109,8 @@ pub struct Config { pub generate_sitemap: bool, /// Enables the generation of robots.txt pub generate_robots_txt: bool, + /// Whether to exclude paginated pages in sitemap; can take values "none", "all" + pub exclude_paginated_pages_in_sitemap: ExcludePaginatedPagesInSitemap, } #[derive(Serialize)] @@ -123,6 +132,7 @@ pub struct SerializedConfig<'a> { search: search::SerializedSearch<'a>, generate_sitemap: bool, generate_robots_txt: bool, + exclude_paginated_pages_in_sitemap: ExcludePaginatedPagesInSitemap, } impl Config { @@ -287,6 +297,10 @@ impl Config { self.mode == Mode::Check } + pub fn should_exclude_paginated_pages_in_sitemap(&self) -> bool { + self.exclude_paginated_pages_in_sitemap == ExcludePaginatedPagesInSitemap::All + } + pub fn enable_serve_mode(&mut self) { self.mode = Mode::Serve; } @@ -340,6 +354,7 @@ impl Config { search: self.search.serialize(), generate_sitemap: self.generate_sitemap, generate_robots_txt: self.generate_robots_txt, + exclude_paginated_pages_in_sitemap: self.exclude_paginated_pages_in_sitemap, } } } @@ -405,6 +420,7 @@ impl Default for Config { extra: HashMap::new(), generate_sitemap: true, generate_robots_txt: true, + exclude_paginated_pages_in_sitemap: ExcludePaginatedPagesInSitemap::None, } } } @@ -1066,4 +1082,6 @@ base_url = "example.com" let config = Config::parse(config).unwrap(); assert!(config.generate_robots_txt); } + + // TODO: add a test for excluding paginated pages } diff --git a/components/site/src/sitemap.rs b/components/site/src/sitemap.rs index 2d9960741..d6c94ecd5 100644 --- a/components/site/src/sitemap.rs +++ b/components/site/src/sitemap.rs @@ -83,10 +83,12 @@ pub fn find_entries<'a>( } if let Some(paginate_by) = s.paginate_by() { - let number_pagers = (s.pages.len() as f64 / paginate_by as f64).ceil() as isize; - for i in 1..=number_pagers { - let permalink = format!("{}{}/{}/", s.permalink, s.meta.paginate_path, i); - entries.insert(SitemapEntry::new(Cow::Owned(permalink), &None)); + if !config.should_exclude_paginated_pages_in_sitemap() { + let number_pagers = (s.pages.len() as f64 / paginate_by as f64).ceil() as isize; + for i in 1..=number_pagers { + let permalink = format!("{}{}/{}/", s.permalink, s.meta.paginate_path, i); + entries.insert(SitemapEntry::new(Cow::Owned(permalink), &None)); + } } } } @@ -100,7 +102,7 @@ pub fn find_entries<'a>( for item in &taxonomy.items { entries.insert(SitemapEntry::new(Cow::Borrowed(&item.permalink), &None)); - if taxonomy.kind.is_paginated() { + if taxonomy.kind.is_paginated() && !config.should_exclude_paginated_pages_in_sitemap() { let number_pagers = (item.pages.len() as f64 / taxonomy.kind.paginate_by.unwrap() as f64) .ceil() as isize; diff --git a/docs/content/documentation/getting-started/configuration.md b/docs/content/documentation/getting-started/configuration.md index 2565e0913..7b5f439bf 100644 --- a/docs/content/documentation/getting-started/configuration.md +++ b/docs/content/documentation/getting-started/configuration.md @@ -67,6 +67,9 @@ ignored_static = [] # When set to "true", a feed is automatically generated. generate_feeds = false +# When set to "all", paginated pages are not a part of the sitemap, default is "none" +exclude_paginated_pages_in_sitemap = "none" + # The filenames to use for the feeds. Used as the template filenames, too. # Defaults to ["atom.xml"], which has a built-in template that renders an Atom 1.0 feed. # There is also a built-in template "rss.xml" that renders an RSS 2.0 feed. diff --git a/docs/content/documentation/templates/pagination.md b/docs/content/documentation/templates/pagination.md index e1851bdce..ad4c956cc 100644 --- a/docs/content/documentation/templates/pagination.md +++ b/docs/content/documentation/templates/pagination.md @@ -52,6 +52,12 @@ A paginated taxonomy gets two variables aside from the `paginator` variable: See the [taxonomies page](@/documentation/templates/taxonomies.md) for a detailed version of the types. +## SEO + +It is preferable to not include paginated pages in sitemap since they are non-canonical pages. +To exclude paginated pages in sitemap, set the +`exclude_paginated_pages_in_sitemap` as `all` in `config.toml`. + ## Example Here is an example from a theme on how to use pagination on a page (`index.html` in this case): From 481135f93a950a8e89f97e2192c5860895a03b77 Mon Sep 17 00:00:00 2001 From: Henrik Gerdes Date: Fri, 13 Sep 2024 09:29:54 +0200 Subject: [PATCH 03/10] feat: build relases on gh-actions & support linux arm64 (#2629) * feat: port zola release build to gh actions & support linux arm64 Signed-off-by: Henrik Gerdes * fix: add buildx support for multi-arch docker images Signed-off-by: Henrik Gerdes * fix: pin gh release action to sha & allow pre-releases Signed-off-by: Henrik Gerdes * fix: use env in gh action for linux arm build Signed-off-by: Henrik Gerdes * chore: switch to dtolnay/rust-toolchain action for rust setup Signed-off-by: Henrik Gerdes * fix: windows archive step Signed-off-by: Henrik Gerdes --------- Signed-off-by: Henrik Gerdes --- .github/workflows/build-and-test.yml | 66 +++++++++++ .github/workflows/cd-workflow.yml | 50 -------- .github/workflows/docs.yml | 2 +- .github/workflows/release.yml | 165 +++++++++++++++++++++++++++ Dockerfile | 21 +++- 5 files changed, 248 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/build-and-test.yml delete mode 100644 .github/workflows/cd-workflow.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 000000000..784fc2859 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,66 @@ +name: Build & Test + +on: + push: + branches: ["*"] + +env: + # Cross-compilation for aarch64 requires a different linker + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + +permissions: + contents: read + +jobs: + Tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-pc-windows-msvc + - x86_64-apple-darwin + - aarch64-apple-darwin + rustup_toolchain: [stable] + include: + - os: windows-2022 + target: x86_64-pc-windows-msvc + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + - os: macos-13 + target: x86_64-apple-darwin + - os: macos-14 + target: aarch64-apple-darwin + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rustup_toolchain }} + + - name: Install Rust crosscompile tools + if: ${{ contains(matrix.target, 'aarch64-unknown-linux-gnu') }} + run: | + sudo apt-get update -y + sudo apt-get install -y make g++ libssl-dev gcc-aarch64-linux-gnu + rustup target add aarch64-unknown-linux-gnu + + - name: Cargo build (Native TLS) + run: | + cargo build --all --no-default-features --features=native-tls + cargo clean + + - name: Cargo build (Rust TLS) + run: cargo build --all + + - name: Cargo test + run: cargo test --all + + - name: Cargo fmt + run: cargo fmt --check diff --git a/.github/workflows/cd-workflow.yml b/.github/workflows/cd-workflow.yml deleted file mode 100644 index 6d20ea766..000000000 --- a/.github/workflows/cd-workflow.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Mostly copied from https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action -# Main difference is the push filter on the tag. -# -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Create and publish a Docker image - -on: - push: - tags: [ 'v*.*.*' ] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - flavor: latest=false - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1f1db2fb7..ba06fdecc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ jobs: env: BUILD_DIR: docs/ BUILD_ONLY: true - + build_and_deploy: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..ae79c850b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,165 @@ +name: Release + +on: + push: + tags: ["v*.*.*"] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + # Cross-compilation for aarch64 requires a different linker + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + +permissions: + contents: read + +jobs: + Release-Build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + attestations: write + id-token: write + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-pc-windows-msvc + - x86_64-apple-darwin + - aarch64-apple-darwin + rustup_toolchain: [stable] + include: + - os: windows-2022 + target: x86_64-pc-windows-msvc + - os: ubuntu-20.04 + target: x86_64-unknown-linux-gnu + - os: ubuntu-20.04 + target: aarch64-unknown-linux-gnu + - os: macos-13 + target: x86_64-apple-darwin + - os: macos-14 + target: aarch64-apple-darwin + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rustup_toolchain }} + + - name: Install Rust crosscompile tools + if: ${{ contains(matrix.target, 'aarch64-unknown-linux-gnu') }} + run: | + sudo apt-get update -y + sudo apt-get install -y make g++ libssl-dev gcc-aarch64-linux-gnu + rustup target add aarch64-unknown-linux-gnu + + - name: Cargo build + run: cargo build --release --target ${{ matrix.target }} + + - name: Archive (UNIX) + run: | + mkdir -p artifacts + cp -av target/${{ matrix.target }}/release/zola . + tar -czf ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz zola + if: ${{ ! startsWith(matrix.os, 'windows') }} + + - name: Archive (Windows) + run: | + mkdir -p artifacts + cp target/${{ matrix.target }}/release/zola.exe . + Compress-Archive zola.exe ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }}.zip + if: ${{ startsWith(matrix.os, 'windows') }} + + - name: Attest Build Provenance + uses: actions/attest-build-provenance@v1 + continue-on-error: true + with: + subject-path: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }}.* + + - uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }} + path: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }}.* + if-no-files-found: error + retention-days: 7 + + Release: + needs: [Release-Build] + runs-on: ubuntu-22.04 + permissions: + contents: write + + steps: + - name: Ensure artifacts dir exists + run: mkdir -p artifacts + + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + path: artifacts + merge-multiple: true + + - name: Release + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 + with: + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} + generate_release_notes: true + fail_on_unmatched_files: true + body: | + Welcome to this new release of Zola ${{ github.ref_name }}! + + All artifacts are signed with this repos identity using Sigstore. + You can verify the signatures using the `GitHub` CLI. + + ```shell + gh attestation verify --owner ${{ github.repository_owner }} + ``` + token: ${{ secrets.GITHUB_TOKEN }} + prerelease: ${{ contains(github.ref, '-pre') }} + files: artifacts/* + + Release-Container-Image: + needs: [Release] + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: latest=false + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + build-args: | + USE_GH_RELEASE=true + ZOLA_RELEASE_VERSION=${{ github.ref_name }} + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 87b3ec247..0741cc93c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,26 @@ FROM rust:slim-bookworm AS builder +ARG USE_GH_RELEASE=false +ARG ZOLA_RELEASE_VERSION=latest RUN apt-get update -y && \ - apt-get install -y make g++ libssl-dev && \ - rustup target add x86_64-unknown-linux-gnu + apt-get install -y pkg-config make g++ libssl-dev curl jq tar gzip WORKDIR /app COPY . . -RUN cargo build --release --target x86_64-unknown-linux-gnu - +RUN if [ "${USE_GH_RELEASE}" = "true" ]; then \ + if [ "${ZOLA_RELEASE_VERSION}" = "latest" ]; then \ + export ZOLA_VERSION=$(curl -sL https://api.github.com/repos/getzola/zola/releases/latest | jq -r .name); \ + else \ + export ZOLA_VERSION="${ZOLA_RELEASE_VERSION}"; \ + fi && \ + curl -sL --fail --output zola.tar.gz https://github.com/getzola/zola/releases/download/${ZOLA_VERSION}/zola-${ZOLA_VERSION}-$(uname -m)-unknown-linux-gnu.tar.gz && \ + tar -xzvf zola.tar.gz zola; \ + else \ + cargo build --release && \ + cp target/$(uname -m)-unknown-linux-gnu/release/zola zola; \ + fi && ./zola --version FROM gcr.io/distroless/cc-debian12 -COPY --from=builder /app/target/x86_64-unknown-linux-gnu/release/zola /bin/zola +COPY --from=builder /app/zola /bin/zola ENTRYPOINT [ "/bin/zola" ] From 45c558dec12c22cb526f431418abbae36399aa87 Mon Sep 17 00:00:00 2001 From: xixishidibei Date: Wed, 18 Sep 2024 23:11:40 +0800 Subject: [PATCH 04/10] chore: add missing symbol (#2641) Signed-off-by: xixishidibei --- components/markdown/src/shortcode/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/markdown/src/shortcode/mod.rs b/components/markdown/src/shortcode/mod.rs index 4239ed4d3..92ca6641d 100644 --- a/components/markdown/src/shortcode/mod.rs +++ b/components/markdown/src/shortcode/mod.rs @@ -19,7 +19,7 @@ pub fn extract_shortcodes( if let Some(def) = definitions.get(&sc.name) { sc.tera_name = def.tera_name.clone(); } else { - return Err(Error::msg(format!("Found usage of a shortcode named `{}` but we do not know about. Make sure it's not a typo and that a field name `{}.{{html,md}} exists in the `templates/shortcodes` directory.", sc.name, sc.name))); + return Err(Error::msg(format!("Found usage of a shortcode named `{}` but we do not know about. Make sure it's not a typo and that a field name `{}.{{html,md}}` exists in the `templates/shortcodes` directory.", sc.name, sc.name))); } } From 6798b6eadfa263ab74509aedf87d04ccf6a87165 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Sun, 22 Sep 2024 15:13:06 +0200 Subject: [PATCH 05/10] remove square brackets --- components/markdown/src/markdown.rs | 4 ++-- .../markdown__markdown__tests__def_before_use.snap | 2 +- ..._markdown__tests__footnote_inside_footnote.snap | 4 ++-- .../markdown__markdown__tests__multiple_refs.snap | 2 +- ...down__markdown__tests__reordered_footnotes.snap | 2 +- ...markdown__markdown__tests__single_footnote.snap | 2 +- .../markdown__github_style_footnotes.snap | 14 +++++++------- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index 8bdc778e2..41a59a779 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -277,7 +277,7 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec) { // nr is a number of references to this footnote let (n, nr) = footnote_numbers.entry(name.clone()).or_insert((n, 0usize)); *nr += 1; - let reference = Event::Html(format!(r##"[{n}]"##).into()); + let reference = Event::Html(format!(r##"{n}"##).into()); if footnote_bodies_stack.is_empty() { // we are in the main text, just output the reference @@ -341,7 +341,7 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec) { // // HTML: // - //

five [1].

+ //

five 1.

// //
    //
  1. diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap b/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap index 57e3a922a..698d689fc 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap @@ -2,7 +2,7 @@ source: components/markdown/src/markdown.rs expression: html --- -

    There is footnote definition?[1]

    +

    There is footnote definition?1


    1. It's before the reference.

      diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap b/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap index 6b5e28d47..58a2d9b22 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap @@ -2,10 +2,10 @@ source: components/markdown/src/markdown.rs expression: html --- -

      This text has a footnote[1]

      +

      This text has a footnote1


      1. -

        But the footnote has another footnote[2].

        +

        But the footnote has another footnote2.

      2. That's it.

        diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap b/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap index 1f7eaff18..d53e9ee33 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap @@ -2,7 +2,7 @@ source: components/markdown/src/markdown.rs expression: html --- -

        This text has two[1] identical footnotes[1]

        +

        This text has two1 identical footnotes1


        1. So one is present. ↩2

          diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap b/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap index 865a344e5..9fddfea39 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap @@ -2,7 +2,7 @@ source: components/markdown/src/markdown.rs expression: html --- -

          This text has two[1] footnotes[2]

          +

          This text has two1 footnotes2


          1. But they are

            diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap b/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap index 34a7f2d3e..604489ab7 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap @@ -2,7 +2,7 @@ source: components/markdown/src/markdown.rs expression: html --- -

            This text has a footnote[1]

            +

            This text has a footnote1


            1. But it is meaningless.

              diff --git a/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap b/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap index de55e63fb..07d7fc5f6 100644 --- a/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap +++ b/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap @@ -2,12 +2,12 @@ source: components/markdown/tests/markdown.rs expression: body --- -

              This text has a footnote[1]

              -

              This text has two[2] footnotes[3].

              -

              There is footnote definition?[4]

              -

              This text has two[5] identical footnotes[5]

              -

              This text has a footnote[6]

              -

              Footnotes can also be referenced with identifiers[8].

              +

              This text has a footnote1

              +

              This text has two2 footnotes3.

              +

              There is footnote definition?4

              +

              This text has two5 identical footnotes5

              +

              This text has a footnote6

              +

              Footnotes can also be referenced with identifiers8.


              1. But it is meaningless.

                @@ -25,7 +25,7 @@ expression: body

                So one is present. ↩2

              2. -

                But the footnote has another footnote[7].

                +

                But the footnote has another footnote7.

              3. That's it.

                From ead17d0a3a20bfb67043a076c061b35ae6b6ddea Mon Sep 17 00:00:00 2001 From: Sam Wilson <57262657+SamWilsn@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:55:49 -0400 Subject: [PATCH 06/10] Allow treating a missing highlight language as error (#2642) --- components/config/src/config/markup.rs | 3 +++ components/markdown/src/codeblock/mod.rs | 18 ++++++++++++------ components/markdown/src/markdown.rs | 8 +++++++- .../getting-started/configuration.md | 3 +++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/components/config/src/config/markup.rs b/components/config/src/config/markup.rs index 580a665ae..9ea5b2337 100644 --- a/components/config/src/config/markup.rs +++ b/components/config/src/config/markup.rs @@ -27,6 +27,8 @@ pub struct ThemeCss { pub struct Markdown { /// Whether to highlight all code blocks found in markdown files. Defaults to false pub highlight_code: bool, + /// Emit an error for missing highlight languages. Defaults to false + pub error_on_missing_highlight: bool, /// Which themes to use for code highlighting. See Readme for supported themes /// Defaults to "base16-ocean-dark" pub highlight_theme: String, @@ -198,6 +200,7 @@ impl Default for Markdown { fn default() -> Markdown { Markdown { highlight_code: false, + error_on_missing_highlight: false, highlight_theme: DEFAULT_HIGHLIGHT_THEME.to_owned(), highlight_themes_css: Vec::new(), render_emoji: false, diff --git a/components/markdown/src/codeblock/mod.rs b/components/markdown/src/codeblock/mod.rs index 5e297926f..fd0c1d93f 100644 --- a/components/markdown/src/codeblock/mod.rs +++ b/components/markdown/src/codeblock/mod.rs @@ -3,6 +3,7 @@ mod highlight; use std::ops::RangeInclusive; +use errors::{bail, Result}; use libs::syntect::util::LinesWithEndings; use crate::codeblock::highlight::SyntaxHighlighter; @@ -75,14 +76,19 @@ impl<'config> CodeBlock<'config> { config: &'config Config, // path to the current file if there is one, to point where the error is path: Option<&'config str>, - ) -> (Self, String) { + ) -> Result<(Self, String)> { let syntax_and_theme = resolve_syntax_and_theme(fence.language, config); if syntax_and_theme.source == HighlightSource::NotFound && config.markdown.highlight_code { let lang = fence.language.unwrap(); - if let Some(p) = path { - eprintln!("Warning: Highlight language {} not found in {}", lang, p); + let msg = if let Some(p) = path { + format!("Highlight language {} not found in {}", lang, p) } else { - eprintln!("Warning: Highlight language {} not found", lang); + format!("Highlight language {} not found", lang) + }; + if config.markdown.error_on_missing_highlight { + bail!(msg); + } else { + eprintln!("Warning: {}", msg); } } let highlighter = SyntaxHighlighter::new(config.markdown.highlight_code, syntax_and_theme); @@ -93,7 +99,7 @@ impl<'config> CodeBlock<'config> { highlighter.pre_class(), fence.line_numbers, ); - ( + Ok(( Self { highlighter, line_numbers: fence.line_numbers, @@ -102,7 +108,7 @@ impl<'config> CodeBlock<'config> { hide_lines: fence.hide_lines, }, html_start, - ) + )) } pub fn highlight(&mut self, content: &str) -> String { diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index 41a59a779..16210b384 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -559,7 +559,13 @@ pub fn markdown_to_html( cmark::CodeBlockKind::Fenced(fence_info) => FenceSettings::new(fence_info), _ => FenceSettings::new(""), }; - let (block, begin) = CodeBlock::new(fence, context.config, path); + let (block, begin) = match CodeBlock::new(fence, context.config, path) { + Ok(cb) => cb, + Err(e) => { + error = Some(e); + break; + } + }; code_block = Some(block); events.push(Event::Html(begin.into())); } diff --git a/docs/content/documentation/getting-started/configuration.md b/docs/content/documentation/getting-started/configuration.md index 7b5f439bf..0591b021d 100644 --- a/docs/content/documentation/getting-started/configuration.md +++ b/docs/content/documentation/getting-started/configuration.md @@ -114,6 +114,9 @@ generate_robots_txt = true # When set to "true", all code blocks are highlighted. highlight_code = false +# When set to "true", missing highlight languages are treated as errors. Defaults to false. +error_on_missing_highlight = false + # A list of directories used to search for additional `.sublime-syntax` and `.tmTheme` files. extra_syntaxes_and_themes = [] From 9119e9f03f9f792be4fb14a9d1295616b2172aa7 Mon Sep 17 00:00:00 2001 From: bemyak Date: Fri, 11 Oct 2024 16:34:10 +0300 Subject: [PATCH 07/10] Move sublime into config module (#2580) Having a crate depend on files outside of its directory breaks building Zola as a dependency using Nix --- .gitmodules | 48 +++++++++--------- components/config/src/highlighting.rs | 4 +- .../config/sublime}/syntaxes/Packages | 0 .../extra/Assembly x86.sublime-syntax | 0 .../syntaxes/extra/CSV.sublime-syntax | 0 .../syntaxes/extra/Crystal.sublime-syntax | 0 .../syntaxes/extra/Dart.sublime-syntax | 0 .../sublime}/syntaxes/extra/Docker.tmbundle | 0 .../sublime}/syntaxes/extra/GDScript-sublime | 0 .../syntaxes/extra/GraphQL-SublimeText3 | 0 .../syntaxes/extra/Handlebars.sublime-syntax | 0 .../sublime}/syntaxes/extra/Julia-sublime | 0 .../syntaxes/extra/Kotlin.sublime-syntax | 0 .../sublime}/syntaxes/extra/LESS-sublime | 0 .../syntaxes/extra/MZN.sublime-syntax | 0 .../syntaxes/extra/Nim.sublime-syntax | 0 .../syntaxes/extra/Nix.sublime-syntax | 0 .../syntaxes/extra/PowerShell.sublime-syntax | 0 .../syntaxes/extra/Prolog.sublime-syntax | 0 .../config/sublime}/syntaxes/extra/README.md | 0 .../syntaxes/extra/Racket.sublime-syntax | 0 .../syntaxes/extra/Reason.sublime-syntax | 0 .../syntaxes/extra/Stylus.sublime-syntax | 0 .../syntaxes/extra/Sublime-CMakeLists | 0 .../syntaxes/extra/Sublime-GenericConfig | 0 .../syntaxes/extra/SublimeElmLanguageSupport | 0 .../sublime}/syntaxes/extra/SublimeFortran | 0 .../sublime}/syntaxes/extra/SublimeSass | 0 .../syntaxes/extra/SublimeTextLinkerSyntax | 0 .../syntaxes/extra/Swift.sublime-syntax | 0 .../syntaxes/extra/TypeScript.sublime-syntax | 0 .../extra/TypeScriptReact.sublime-syntax | 0 .../syntaxes/extra/VimL.sublime-syntax | 0 .../sublime}/syntaxes/extra/awk-sublime | 0 .../syntaxes/extra/elixir-sublime-syntax | 0 .../syntaxes/extra/lrc.sublime-syntax | 0 .../extra/protobuf-syntax-highlighting | 0 .../syntaxes/extra/srt.sublime-syntax | 0 .../sublime}/syntaxes/extra/sublime-clojure | 0 .../sublime}/syntaxes/extra/sublime-fish | 0 .../sublime}/syntaxes/extra/sublime-glsl | 0 .../sublime}/syntaxes/extra/sublime-jinja2 | 0 .../syntaxes/extra/sublime-purescript-syntax | 0 .../syntaxes/extra/sublime-zig-language | 0 .../syntaxes/extra/sublime_toml_highlighting | 0 .../syntaxes/extra/sublimetext-fsharp | 0 .../syntaxes/extra/vue-syntax-highlight | 0 .../sublime}/syntaxes/newlines.packdump | Bin .../config/sublime}/themes/1337.tmTheme | 0 .../sublime}/themes/OneHalfDark.tmTheme | 0 .../sublime}/themes/OneHalfLight.tmTheme | 0 .../config/sublime}/themes/Tomorrow.tmTheme | 0 .../config/sublime}/themes/agola-dark.tmTheme | 0 .../config/sublime}/themes/all.themedump | Bin .../sublime}/themes/ascetic-white.tmTheme | 0 .../config/sublime}/themes/axar.tmTheme | 0 .../config/sublime}/themes/ayu-dark.tmTheme | 0 .../config/sublime}/themes/ayu-light.tmTheme | 0 .../config/sublime}/themes/ayu-mirage.tmTheme | 0 .../themes/base16-atelierdune-light.tmTheme | 0 .../sublime}/themes/base16-ocean-dark.tmTheme | 0 .../themes/base16-ocean-light.tmTheme | 0 .../config/sublime}/themes/bbedit.tmTheme | 0 .../config/sublime}/themes/boron.tmTheme | 0 .../config/sublime}/themes/charcoal.tmTheme | 0 .../sublime}/themes/cheerfully-light.tmTheme | 0 .../sublime}/themes/classic-modified.tmTheme | 0 .../config/sublime}/themes/demain.tmTheme | 0 .../sublime}/themes/dimmed-fluid.tmTheme | 0 .../config/sublime}/themes/dracula.tmTheme | 0 .../sublime}/themes/gray-matter-dark.tmTheme | 0 .../config/sublime}/themes/green.tmTheme | 0 .../sublime}/themes/gruvbox-dark.tmTheme | 0 .../sublime}/themes/gruvbox-light.tmTheme | 0 .../config/sublime}/themes/idle.tmTheme | 0 .../sublime}/themes/inspired-github.tmTheme | 0 .../config/sublime}/themes/ir-white.tmTheme | 0 .../config/sublime}/themes/kronuz.tmTheme | 0 .../sublime}/themes/material-dark.tmTheme | 0 .../sublime}/themes/material-light.tmTheme | 0 .../config/sublime}/themes/monokai.tmTheme | 0 .../config/sublime}/themes/nord.tmTheme | 0 .../config/sublime}/themes/nyx-bold.tmTheme | 0 .../config/sublime}/themes/one-dark.tmTheme | 0 .../railsbase16-green-screen-dark.tmTheme | 0 .../sublime}/themes/solarized-dark.tmTheme | 0 .../sublime}/themes/solarized-light.tmTheme | 0 .../sublime}/themes/subway-madrid.tmTheme | 0 .../sublime}/themes/subway-moscow.tmTheme | 0 .../config/sublime}/themes/two-dark.tmTheme | 0 .../themes/visual-studio-dark.tmTheme | 0 .../config/sublime}/themes/zenburn.tmTheme | 0 92 files changed, 26 insertions(+), 26 deletions(-) rename {sublime => components/config/sublime}/syntaxes/Packages (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Assembly x86.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/CSV.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Crystal.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Dart.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Docker.tmbundle (100%) rename {sublime => components/config/sublime}/syntaxes/extra/GDScript-sublime (100%) rename {sublime => components/config/sublime}/syntaxes/extra/GraphQL-SublimeText3 (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Handlebars.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Julia-sublime (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Kotlin.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/LESS-sublime (100%) rename {sublime => components/config/sublime}/syntaxes/extra/MZN.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Nim.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Nix.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/PowerShell.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Prolog.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/README.md (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Racket.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Reason.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Stylus.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Sublime-CMakeLists (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Sublime-GenericConfig (100%) rename {sublime => components/config/sublime}/syntaxes/extra/SublimeElmLanguageSupport (100%) rename {sublime => components/config/sublime}/syntaxes/extra/SublimeFortran (100%) rename {sublime => components/config/sublime}/syntaxes/extra/SublimeSass (100%) rename {sublime => components/config/sublime}/syntaxes/extra/SublimeTextLinkerSyntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/Swift.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/TypeScript.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/TypeScriptReact.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/VimL.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/awk-sublime (100%) rename {sublime => components/config/sublime}/syntaxes/extra/elixir-sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/lrc.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/protobuf-syntax-highlighting (100%) rename {sublime => components/config/sublime}/syntaxes/extra/srt.sublime-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-clojure (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-fish (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-glsl (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-jinja2 (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-purescript-syntax (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime-zig-language (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublime_toml_highlighting (100%) rename {sublime => components/config/sublime}/syntaxes/extra/sublimetext-fsharp (100%) rename {sublime => components/config/sublime}/syntaxes/extra/vue-syntax-highlight (100%) rename {sublime => components/config/sublime}/syntaxes/newlines.packdump (100%) rename {sublime => components/config/sublime}/themes/1337.tmTheme (100%) rename {sublime => components/config/sublime}/themes/OneHalfDark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/OneHalfLight.tmTheme (100%) rename {sublime => components/config/sublime}/themes/Tomorrow.tmTheme (100%) rename {sublime => components/config/sublime}/themes/agola-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/all.themedump (100%) rename {sublime => components/config/sublime}/themes/ascetic-white.tmTheme (100%) rename {sublime => components/config/sublime}/themes/axar.tmTheme (100%) rename {sublime => components/config/sublime}/themes/ayu-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/ayu-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/ayu-mirage.tmTheme (100%) rename {sublime => components/config/sublime}/themes/base16-atelierdune-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/base16-ocean-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/base16-ocean-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/bbedit.tmTheme (100%) rename {sublime => components/config/sublime}/themes/boron.tmTheme (100%) rename {sublime => components/config/sublime}/themes/charcoal.tmTheme (100%) rename {sublime => components/config/sublime}/themes/cheerfully-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/classic-modified.tmTheme (100%) rename {sublime => components/config/sublime}/themes/demain.tmTheme (100%) rename {sublime => components/config/sublime}/themes/dimmed-fluid.tmTheme (100%) rename {sublime => components/config/sublime}/themes/dracula.tmTheme (100%) rename {sublime => components/config/sublime}/themes/gray-matter-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/green.tmTheme (100%) rename {sublime => components/config/sublime}/themes/gruvbox-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/gruvbox-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/idle.tmTheme (100%) rename {sublime => components/config/sublime}/themes/inspired-github.tmTheme (100%) rename {sublime => components/config/sublime}/themes/ir-white.tmTheme (100%) rename {sublime => components/config/sublime}/themes/kronuz.tmTheme (100%) rename {sublime => components/config/sublime}/themes/material-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/material-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/monokai.tmTheme (100%) rename {sublime => components/config/sublime}/themes/nord.tmTheme (100%) rename {sublime => components/config/sublime}/themes/nyx-bold.tmTheme (100%) rename {sublime => components/config/sublime}/themes/one-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/railsbase16-green-screen-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/solarized-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/solarized-light.tmTheme (100%) rename {sublime => components/config/sublime}/themes/subway-madrid.tmTheme (100%) rename {sublime => components/config/sublime}/themes/subway-moscow.tmTheme (100%) rename {sublime => components/config/sublime}/themes/two-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/visual-studio-dark.tmTheme (100%) rename {sublime => components/config/sublime}/themes/zenburn.tmTheme (100%) diff --git a/.gitmodules b/.gitmodules index aba5d052a..19bd59a65 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,78 +1,78 @@ [submodule "sublime/syntaxes/Packages"] - path = sublime/syntaxes/Packages + path = components/config/sublime/syntaxes/Packages url = https://github.com/sublimehq/Packages.git [submodule "sublime/syntaxes/awk-sublime"] - path = sublime/syntaxes/extra/awk-sublime + path = components/config/sublime/syntaxes/extra/awk-sublime url = https://github.com/JohnNilsson/awk-sublime.git [submodule "sublime/syntaxes/AsciiDoc"] path = sublime/syntaxes/AsciiDoc url = https://github.com/SublimeText/AsciiDoc.git [submodule "sublime/syntaxes/Sublime-CMakeLists"] - path = sublime/syntaxes/extra/Sublime-CMakeLists + path = components/config/sublime/syntaxes/extra/Sublime-CMakeLists url = https://github.com/zyxar/Sublime-CMakeLists.git [submodule "sublime/syntaxes/SublimeTextLinkerSyntax"] - path = sublime/syntaxes/extra/SublimeTextLinkerSyntax + path = components/config/sublime/syntaxes/extra/SublimeTextLinkerSyntax url = https://github.com/jbw3/SublimeTextLinkerSyntax [submodule "sublime/syntaxes/Docker.tmbundle"] - path = sublime/syntaxes/extra/Docker.tmbundle + path = components/config/sublime/syntaxes/extra/Docker.tmbundle url = https://github.com/asbjornenge/Docker.tmbundle.git [submodule "sublime/syntaxes/Sublime-VimL"] path = sublime/syntaxes/Sublime-VimL url = https://github.com/SalGnt/Sublime-VimL.git [submodule "sublime/syntaxes/elixir-sublime-syntax"] - path = sublime/syntaxes/extra/elixir-sublime-syntax + path = components/config/sublime/syntaxes/extra/elixir-sublime-syntax url = https://github.com/princemaple/elixir-sublime-syntax.git [submodule "sublime/syntaxes/SublimeElmLanguageSupport"] - path = sublime/syntaxes/extra/SublimeElmLanguageSupport + path = components/config/sublime/syntaxes/extra/SublimeElmLanguageSupport url = https://github.com/elm-community/SublimeElmLanguageSupport.git [submodule "sublime/syntaxes/sublimetext-fsharp"] - path = sublime/syntaxes/extra/sublimetext-fsharp + path = components/config/sublime/syntaxes/extra/sublimetext-fsharp url = https://github.com/hoest/sublimetext-fsharp.git [submodule "sublime/syntaxes/sublime-fish"] - path = sublime/syntaxes/extra/sublime-fish + path = components/config/sublime/syntaxes/extra/sublime-fish url = https://github.com/Phidica/sublime-fish.git [submodule "sublime/syntaxes/SublimeFortran"] - path = sublime/syntaxes/extra/SublimeFortran + path = components/config/sublime/syntaxes/extra/SublimeFortran url = https://github.com/315234/SublimeFortran.git [submodule "sublime/syntaxes/GraphQL-SublimeText3"] - path = sublime/syntaxes/extra/GraphQL-SublimeText3 + path = components/config/sublime/syntaxes/extra/GraphQL-SublimeText3 url = https://github.com/dncrews/GraphQL-SublimeText3.git [submodule "sublime/syntaxes/Sublime-GenericConfig"] - path = sublime/syntaxes/extra/Sublime-GenericConfig + path = components/config/sublime/syntaxes/extra/Sublime-GenericConfig url = https://github.com/skozlovf/Sublime-GenericConfig.git [submodule "sublime/syntaxes/sublime-jinja2"] - path = sublime/syntaxes/extra/sublime-jinja2 + path = components/config/sublime/syntaxes/extra/sublime-jinja2 url = https://github.com/Martin819/sublime-jinja2.git [submodule "sublime/syntaxes/Julia-sublime"] - path = sublime/syntaxes/extra/Julia-sublime + path = components/config/sublime/syntaxes/extra/Julia-sublime url = https://github.com/JuliaEditorSupport/Julia-sublime.git [submodule "sublime/syntaxes/LESS-sublime"] - path = sublime/syntaxes/extra/LESS-sublime + path = components/config/sublime/syntaxes/extra/LESS-sublime url = https://github.com/danro/LESS-sublime.git [submodule "sublime/syntaxes/sublime-purescript-syntax"] - path = sublime/syntaxes/extra/sublime-purescript-syntax + path = components/config/sublime/syntaxes/extra/sublime-purescript-syntax url = https://github.com/tellnobody1/sublime-purescript-syntax.git [submodule "sublime/syntaxes/SublimeSass"] - path = sublime/syntaxes/extra/SublimeSass + path = components/config/sublime/syntaxes/extra/SublimeSass url = https://github.com/braver/SublimeSass.git [submodule "sublime/syntaxes/sublime_toml_highlighting"] - path = sublime/syntaxes/extra/sublime_toml_highlighting + path = components/config/sublime/syntaxes/extra/sublime_toml_highlighting url = https://github.com/jasonwilliams/sublime_toml_highlighting.git [submodule "sublime/syntaxes/vue-syntax-highlight"] - path = sublime/syntaxes/extra/vue-syntax-highlight + path = components/config/sublime/syntaxes/extra/vue-syntax-highlight url = https://github.com/vuejs/vue-syntax-highlight.git [submodule "sublime/syntaxes/sublime-glsl"] - path = sublime/syntaxes/extra/sublime-glsl + path = components/config/sublime/syntaxes/extra/sublime-glsl url = https://github.com/euler0/sublime-glsl.git [submodule "sublime/syntaxes/GDScript-sublime"] - path = sublime/syntaxes/extra/GDScript-sublime + path = components/config/sublime/syntaxes/extra/GDScript-sublime url = https://github.com/beefsack/GDScript-sublime.git [submodule "sublime/syntaxes/extra/sublime-clojure"] - path = sublime/syntaxes/extra/sublime-clojure + path = components/config/sublime/syntaxes/extra/sublime-clojure url = https://github.com/tonsky/sublime-clojure.git [submodule "sublime/syntaxes/extra/sublime-zig-language"] - path = sublime/syntaxes/extra/sublime-zig-language + path = components/config/sublime/syntaxes/extra/sublime-zig-language url = https://github.com/ziglang/sublime-zig-language.git [submodule "sublime/syntaxes/extra/protobuf-syntax-highlighting"] - path = sublime/syntaxes/extra/protobuf-syntax-highlighting + path = components/config/sublime/syntaxes/extra/protobuf-syntax-highlighting url = https://github.com/VcamX/protobuf-syntax-highlighting.git diff --git a/components/config/src/highlighting.rs b/components/config/src/highlighting.rs index 03cfc95d1..ff50d2258 100644 --- a/components/config/src/highlighting.rs +++ b/components/config/src/highlighting.rs @@ -9,10 +9,10 @@ use crate::config::Config; pub const CLASS_STYLE: ClassStyle = ClassStyle::SpacedPrefixed { prefix: "z-" }; pub static SYNTAX_SET: Lazy = - Lazy::new(|| from_binary(include_bytes!("../../../sublime/syntaxes/newlines.packdump"))); + Lazy::new(|| from_binary(include_bytes!("../sublime/syntaxes/newlines.packdump"))); pub static THEME_SET: Lazy = - Lazy::new(|| from_binary(include_bytes!("../../../sublime/themes/all.themedump"))); + Lazy::new(|| from_binary(include_bytes!("../sublime/themes/all.themedump"))); #[derive(Clone, Debug, PartialEq, Eq)] pub enum HighlightSource { diff --git a/sublime/syntaxes/Packages b/components/config/sublime/syntaxes/Packages similarity index 100% rename from sublime/syntaxes/Packages rename to components/config/sublime/syntaxes/Packages diff --git a/sublime/syntaxes/extra/Assembly x86.sublime-syntax b/components/config/sublime/syntaxes/extra/Assembly x86.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Assembly x86.sublime-syntax rename to components/config/sublime/syntaxes/extra/Assembly x86.sublime-syntax diff --git a/sublime/syntaxes/extra/CSV.sublime-syntax b/components/config/sublime/syntaxes/extra/CSV.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/CSV.sublime-syntax rename to components/config/sublime/syntaxes/extra/CSV.sublime-syntax diff --git a/sublime/syntaxes/extra/Crystal.sublime-syntax b/components/config/sublime/syntaxes/extra/Crystal.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Crystal.sublime-syntax rename to components/config/sublime/syntaxes/extra/Crystal.sublime-syntax diff --git a/sublime/syntaxes/extra/Dart.sublime-syntax b/components/config/sublime/syntaxes/extra/Dart.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Dart.sublime-syntax rename to components/config/sublime/syntaxes/extra/Dart.sublime-syntax diff --git a/sublime/syntaxes/extra/Docker.tmbundle b/components/config/sublime/syntaxes/extra/Docker.tmbundle similarity index 100% rename from sublime/syntaxes/extra/Docker.tmbundle rename to components/config/sublime/syntaxes/extra/Docker.tmbundle diff --git a/sublime/syntaxes/extra/GDScript-sublime b/components/config/sublime/syntaxes/extra/GDScript-sublime similarity index 100% rename from sublime/syntaxes/extra/GDScript-sublime rename to components/config/sublime/syntaxes/extra/GDScript-sublime diff --git a/sublime/syntaxes/extra/GraphQL-SublimeText3 b/components/config/sublime/syntaxes/extra/GraphQL-SublimeText3 similarity index 100% rename from sublime/syntaxes/extra/GraphQL-SublimeText3 rename to components/config/sublime/syntaxes/extra/GraphQL-SublimeText3 diff --git a/sublime/syntaxes/extra/Handlebars.sublime-syntax b/components/config/sublime/syntaxes/extra/Handlebars.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Handlebars.sublime-syntax rename to components/config/sublime/syntaxes/extra/Handlebars.sublime-syntax diff --git a/sublime/syntaxes/extra/Julia-sublime b/components/config/sublime/syntaxes/extra/Julia-sublime similarity index 100% rename from sublime/syntaxes/extra/Julia-sublime rename to components/config/sublime/syntaxes/extra/Julia-sublime diff --git a/sublime/syntaxes/extra/Kotlin.sublime-syntax b/components/config/sublime/syntaxes/extra/Kotlin.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Kotlin.sublime-syntax rename to components/config/sublime/syntaxes/extra/Kotlin.sublime-syntax diff --git a/sublime/syntaxes/extra/LESS-sublime b/components/config/sublime/syntaxes/extra/LESS-sublime similarity index 100% rename from sublime/syntaxes/extra/LESS-sublime rename to components/config/sublime/syntaxes/extra/LESS-sublime diff --git a/sublime/syntaxes/extra/MZN.sublime-syntax b/components/config/sublime/syntaxes/extra/MZN.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/MZN.sublime-syntax rename to components/config/sublime/syntaxes/extra/MZN.sublime-syntax diff --git a/sublime/syntaxes/extra/Nim.sublime-syntax b/components/config/sublime/syntaxes/extra/Nim.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Nim.sublime-syntax rename to components/config/sublime/syntaxes/extra/Nim.sublime-syntax diff --git a/sublime/syntaxes/extra/Nix.sublime-syntax b/components/config/sublime/syntaxes/extra/Nix.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Nix.sublime-syntax rename to components/config/sublime/syntaxes/extra/Nix.sublime-syntax diff --git a/sublime/syntaxes/extra/PowerShell.sublime-syntax b/components/config/sublime/syntaxes/extra/PowerShell.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/PowerShell.sublime-syntax rename to components/config/sublime/syntaxes/extra/PowerShell.sublime-syntax diff --git a/sublime/syntaxes/extra/Prolog.sublime-syntax b/components/config/sublime/syntaxes/extra/Prolog.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Prolog.sublime-syntax rename to components/config/sublime/syntaxes/extra/Prolog.sublime-syntax diff --git a/sublime/syntaxes/extra/README.md b/components/config/sublime/syntaxes/extra/README.md similarity index 100% rename from sublime/syntaxes/extra/README.md rename to components/config/sublime/syntaxes/extra/README.md diff --git a/sublime/syntaxes/extra/Racket.sublime-syntax b/components/config/sublime/syntaxes/extra/Racket.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Racket.sublime-syntax rename to components/config/sublime/syntaxes/extra/Racket.sublime-syntax diff --git a/sublime/syntaxes/extra/Reason.sublime-syntax b/components/config/sublime/syntaxes/extra/Reason.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Reason.sublime-syntax rename to components/config/sublime/syntaxes/extra/Reason.sublime-syntax diff --git a/sublime/syntaxes/extra/Stylus.sublime-syntax b/components/config/sublime/syntaxes/extra/Stylus.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Stylus.sublime-syntax rename to components/config/sublime/syntaxes/extra/Stylus.sublime-syntax diff --git a/sublime/syntaxes/extra/Sublime-CMakeLists b/components/config/sublime/syntaxes/extra/Sublime-CMakeLists similarity index 100% rename from sublime/syntaxes/extra/Sublime-CMakeLists rename to components/config/sublime/syntaxes/extra/Sublime-CMakeLists diff --git a/sublime/syntaxes/extra/Sublime-GenericConfig b/components/config/sublime/syntaxes/extra/Sublime-GenericConfig similarity index 100% rename from sublime/syntaxes/extra/Sublime-GenericConfig rename to components/config/sublime/syntaxes/extra/Sublime-GenericConfig diff --git a/sublime/syntaxes/extra/SublimeElmLanguageSupport b/components/config/sublime/syntaxes/extra/SublimeElmLanguageSupport similarity index 100% rename from sublime/syntaxes/extra/SublimeElmLanguageSupport rename to components/config/sublime/syntaxes/extra/SublimeElmLanguageSupport diff --git a/sublime/syntaxes/extra/SublimeFortran b/components/config/sublime/syntaxes/extra/SublimeFortran similarity index 100% rename from sublime/syntaxes/extra/SublimeFortran rename to components/config/sublime/syntaxes/extra/SublimeFortran diff --git a/sublime/syntaxes/extra/SublimeSass b/components/config/sublime/syntaxes/extra/SublimeSass similarity index 100% rename from sublime/syntaxes/extra/SublimeSass rename to components/config/sublime/syntaxes/extra/SublimeSass diff --git a/sublime/syntaxes/extra/SublimeTextLinkerSyntax b/components/config/sublime/syntaxes/extra/SublimeTextLinkerSyntax similarity index 100% rename from sublime/syntaxes/extra/SublimeTextLinkerSyntax rename to components/config/sublime/syntaxes/extra/SublimeTextLinkerSyntax diff --git a/sublime/syntaxes/extra/Swift.sublime-syntax b/components/config/sublime/syntaxes/extra/Swift.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/Swift.sublime-syntax rename to components/config/sublime/syntaxes/extra/Swift.sublime-syntax diff --git a/sublime/syntaxes/extra/TypeScript.sublime-syntax b/components/config/sublime/syntaxes/extra/TypeScript.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/TypeScript.sublime-syntax rename to components/config/sublime/syntaxes/extra/TypeScript.sublime-syntax diff --git a/sublime/syntaxes/extra/TypeScriptReact.sublime-syntax b/components/config/sublime/syntaxes/extra/TypeScriptReact.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/TypeScriptReact.sublime-syntax rename to components/config/sublime/syntaxes/extra/TypeScriptReact.sublime-syntax diff --git a/sublime/syntaxes/extra/VimL.sublime-syntax b/components/config/sublime/syntaxes/extra/VimL.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/VimL.sublime-syntax rename to components/config/sublime/syntaxes/extra/VimL.sublime-syntax diff --git a/sublime/syntaxes/extra/awk-sublime b/components/config/sublime/syntaxes/extra/awk-sublime similarity index 100% rename from sublime/syntaxes/extra/awk-sublime rename to components/config/sublime/syntaxes/extra/awk-sublime diff --git a/sublime/syntaxes/extra/elixir-sublime-syntax b/components/config/sublime/syntaxes/extra/elixir-sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/elixir-sublime-syntax rename to components/config/sublime/syntaxes/extra/elixir-sublime-syntax diff --git a/sublime/syntaxes/extra/lrc.sublime-syntax b/components/config/sublime/syntaxes/extra/lrc.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/lrc.sublime-syntax rename to components/config/sublime/syntaxes/extra/lrc.sublime-syntax diff --git a/sublime/syntaxes/extra/protobuf-syntax-highlighting b/components/config/sublime/syntaxes/extra/protobuf-syntax-highlighting similarity index 100% rename from sublime/syntaxes/extra/protobuf-syntax-highlighting rename to components/config/sublime/syntaxes/extra/protobuf-syntax-highlighting diff --git a/sublime/syntaxes/extra/srt.sublime-syntax b/components/config/sublime/syntaxes/extra/srt.sublime-syntax similarity index 100% rename from sublime/syntaxes/extra/srt.sublime-syntax rename to components/config/sublime/syntaxes/extra/srt.sublime-syntax diff --git a/sublime/syntaxes/extra/sublime-clojure b/components/config/sublime/syntaxes/extra/sublime-clojure similarity index 100% rename from sublime/syntaxes/extra/sublime-clojure rename to components/config/sublime/syntaxes/extra/sublime-clojure diff --git a/sublime/syntaxes/extra/sublime-fish b/components/config/sublime/syntaxes/extra/sublime-fish similarity index 100% rename from sublime/syntaxes/extra/sublime-fish rename to components/config/sublime/syntaxes/extra/sublime-fish diff --git a/sublime/syntaxes/extra/sublime-glsl b/components/config/sublime/syntaxes/extra/sublime-glsl similarity index 100% rename from sublime/syntaxes/extra/sublime-glsl rename to components/config/sublime/syntaxes/extra/sublime-glsl diff --git a/sublime/syntaxes/extra/sublime-jinja2 b/components/config/sublime/syntaxes/extra/sublime-jinja2 similarity index 100% rename from sublime/syntaxes/extra/sublime-jinja2 rename to components/config/sublime/syntaxes/extra/sublime-jinja2 diff --git a/sublime/syntaxes/extra/sublime-purescript-syntax b/components/config/sublime/syntaxes/extra/sublime-purescript-syntax similarity index 100% rename from sublime/syntaxes/extra/sublime-purescript-syntax rename to components/config/sublime/syntaxes/extra/sublime-purescript-syntax diff --git a/sublime/syntaxes/extra/sublime-zig-language b/components/config/sublime/syntaxes/extra/sublime-zig-language similarity index 100% rename from sublime/syntaxes/extra/sublime-zig-language rename to components/config/sublime/syntaxes/extra/sublime-zig-language diff --git a/sublime/syntaxes/extra/sublime_toml_highlighting b/components/config/sublime/syntaxes/extra/sublime_toml_highlighting similarity index 100% rename from sublime/syntaxes/extra/sublime_toml_highlighting rename to components/config/sublime/syntaxes/extra/sublime_toml_highlighting diff --git a/sublime/syntaxes/extra/sublimetext-fsharp b/components/config/sublime/syntaxes/extra/sublimetext-fsharp similarity index 100% rename from sublime/syntaxes/extra/sublimetext-fsharp rename to components/config/sublime/syntaxes/extra/sublimetext-fsharp diff --git a/sublime/syntaxes/extra/vue-syntax-highlight b/components/config/sublime/syntaxes/extra/vue-syntax-highlight similarity index 100% rename from sublime/syntaxes/extra/vue-syntax-highlight rename to components/config/sublime/syntaxes/extra/vue-syntax-highlight diff --git a/sublime/syntaxes/newlines.packdump b/components/config/sublime/syntaxes/newlines.packdump similarity index 100% rename from sublime/syntaxes/newlines.packdump rename to components/config/sublime/syntaxes/newlines.packdump diff --git a/sublime/themes/1337.tmTheme b/components/config/sublime/themes/1337.tmTheme similarity index 100% rename from sublime/themes/1337.tmTheme rename to components/config/sublime/themes/1337.tmTheme diff --git a/sublime/themes/OneHalfDark.tmTheme b/components/config/sublime/themes/OneHalfDark.tmTheme similarity index 100% rename from sublime/themes/OneHalfDark.tmTheme rename to components/config/sublime/themes/OneHalfDark.tmTheme diff --git a/sublime/themes/OneHalfLight.tmTheme b/components/config/sublime/themes/OneHalfLight.tmTheme similarity index 100% rename from sublime/themes/OneHalfLight.tmTheme rename to components/config/sublime/themes/OneHalfLight.tmTheme diff --git a/sublime/themes/Tomorrow.tmTheme b/components/config/sublime/themes/Tomorrow.tmTheme similarity index 100% rename from sublime/themes/Tomorrow.tmTheme rename to components/config/sublime/themes/Tomorrow.tmTheme diff --git a/sublime/themes/agola-dark.tmTheme b/components/config/sublime/themes/agola-dark.tmTheme similarity index 100% rename from sublime/themes/agola-dark.tmTheme rename to components/config/sublime/themes/agola-dark.tmTheme diff --git a/sublime/themes/all.themedump b/components/config/sublime/themes/all.themedump similarity index 100% rename from sublime/themes/all.themedump rename to components/config/sublime/themes/all.themedump diff --git a/sublime/themes/ascetic-white.tmTheme b/components/config/sublime/themes/ascetic-white.tmTheme similarity index 100% rename from sublime/themes/ascetic-white.tmTheme rename to components/config/sublime/themes/ascetic-white.tmTheme diff --git a/sublime/themes/axar.tmTheme b/components/config/sublime/themes/axar.tmTheme similarity index 100% rename from sublime/themes/axar.tmTheme rename to components/config/sublime/themes/axar.tmTheme diff --git a/sublime/themes/ayu-dark.tmTheme b/components/config/sublime/themes/ayu-dark.tmTheme similarity index 100% rename from sublime/themes/ayu-dark.tmTheme rename to components/config/sublime/themes/ayu-dark.tmTheme diff --git a/sublime/themes/ayu-light.tmTheme b/components/config/sublime/themes/ayu-light.tmTheme similarity index 100% rename from sublime/themes/ayu-light.tmTheme rename to components/config/sublime/themes/ayu-light.tmTheme diff --git a/sublime/themes/ayu-mirage.tmTheme b/components/config/sublime/themes/ayu-mirage.tmTheme similarity index 100% rename from sublime/themes/ayu-mirage.tmTheme rename to components/config/sublime/themes/ayu-mirage.tmTheme diff --git a/sublime/themes/base16-atelierdune-light.tmTheme b/components/config/sublime/themes/base16-atelierdune-light.tmTheme similarity index 100% rename from sublime/themes/base16-atelierdune-light.tmTheme rename to components/config/sublime/themes/base16-atelierdune-light.tmTheme diff --git a/sublime/themes/base16-ocean-dark.tmTheme b/components/config/sublime/themes/base16-ocean-dark.tmTheme similarity index 100% rename from sublime/themes/base16-ocean-dark.tmTheme rename to components/config/sublime/themes/base16-ocean-dark.tmTheme diff --git a/sublime/themes/base16-ocean-light.tmTheme b/components/config/sublime/themes/base16-ocean-light.tmTheme similarity index 100% rename from sublime/themes/base16-ocean-light.tmTheme rename to components/config/sublime/themes/base16-ocean-light.tmTheme diff --git a/sublime/themes/bbedit.tmTheme b/components/config/sublime/themes/bbedit.tmTheme similarity index 100% rename from sublime/themes/bbedit.tmTheme rename to components/config/sublime/themes/bbedit.tmTheme diff --git a/sublime/themes/boron.tmTheme b/components/config/sublime/themes/boron.tmTheme similarity index 100% rename from sublime/themes/boron.tmTheme rename to components/config/sublime/themes/boron.tmTheme diff --git a/sublime/themes/charcoal.tmTheme b/components/config/sublime/themes/charcoal.tmTheme similarity index 100% rename from sublime/themes/charcoal.tmTheme rename to components/config/sublime/themes/charcoal.tmTheme diff --git a/sublime/themes/cheerfully-light.tmTheme b/components/config/sublime/themes/cheerfully-light.tmTheme similarity index 100% rename from sublime/themes/cheerfully-light.tmTheme rename to components/config/sublime/themes/cheerfully-light.tmTheme diff --git a/sublime/themes/classic-modified.tmTheme b/components/config/sublime/themes/classic-modified.tmTheme similarity index 100% rename from sublime/themes/classic-modified.tmTheme rename to components/config/sublime/themes/classic-modified.tmTheme diff --git a/sublime/themes/demain.tmTheme b/components/config/sublime/themes/demain.tmTheme similarity index 100% rename from sublime/themes/demain.tmTheme rename to components/config/sublime/themes/demain.tmTheme diff --git a/sublime/themes/dimmed-fluid.tmTheme b/components/config/sublime/themes/dimmed-fluid.tmTheme similarity index 100% rename from sublime/themes/dimmed-fluid.tmTheme rename to components/config/sublime/themes/dimmed-fluid.tmTheme diff --git a/sublime/themes/dracula.tmTheme b/components/config/sublime/themes/dracula.tmTheme similarity index 100% rename from sublime/themes/dracula.tmTheme rename to components/config/sublime/themes/dracula.tmTheme diff --git a/sublime/themes/gray-matter-dark.tmTheme b/components/config/sublime/themes/gray-matter-dark.tmTheme similarity index 100% rename from sublime/themes/gray-matter-dark.tmTheme rename to components/config/sublime/themes/gray-matter-dark.tmTheme diff --git a/sublime/themes/green.tmTheme b/components/config/sublime/themes/green.tmTheme similarity index 100% rename from sublime/themes/green.tmTheme rename to components/config/sublime/themes/green.tmTheme diff --git a/sublime/themes/gruvbox-dark.tmTheme b/components/config/sublime/themes/gruvbox-dark.tmTheme similarity index 100% rename from sublime/themes/gruvbox-dark.tmTheme rename to components/config/sublime/themes/gruvbox-dark.tmTheme diff --git a/sublime/themes/gruvbox-light.tmTheme b/components/config/sublime/themes/gruvbox-light.tmTheme similarity index 100% rename from sublime/themes/gruvbox-light.tmTheme rename to components/config/sublime/themes/gruvbox-light.tmTheme diff --git a/sublime/themes/idle.tmTheme b/components/config/sublime/themes/idle.tmTheme similarity index 100% rename from sublime/themes/idle.tmTheme rename to components/config/sublime/themes/idle.tmTheme diff --git a/sublime/themes/inspired-github.tmTheme b/components/config/sublime/themes/inspired-github.tmTheme similarity index 100% rename from sublime/themes/inspired-github.tmTheme rename to components/config/sublime/themes/inspired-github.tmTheme diff --git a/sublime/themes/ir-white.tmTheme b/components/config/sublime/themes/ir-white.tmTheme similarity index 100% rename from sublime/themes/ir-white.tmTheme rename to components/config/sublime/themes/ir-white.tmTheme diff --git a/sublime/themes/kronuz.tmTheme b/components/config/sublime/themes/kronuz.tmTheme similarity index 100% rename from sublime/themes/kronuz.tmTheme rename to components/config/sublime/themes/kronuz.tmTheme diff --git a/sublime/themes/material-dark.tmTheme b/components/config/sublime/themes/material-dark.tmTheme similarity index 100% rename from sublime/themes/material-dark.tmTheme rename to components/config/sublime/themes/material-dark.tmTheme diff --git a/sublime/themes/material-light.tmTheme b/components/config/sublime/themes/material-light.tmTheme similarity index 100% rename from sublime/themes/material-light.tmTheme rename to components/config/sublime/themes/material-light.tmTheme diff --git a/sublime/themes/monokai.tmTheme b/components/config/sublime/themes/monokai.tmTheme similarity index 100% rename from sublime/themes/monokai.tmTheme rename to components/config/sublime/themes/monokai.tmTheme diff --git a/sublime/themes/nord.tmTheme b/components/config/sublime/themes/nord.tmTheme similarity index 100% rename from sublime/themes/nord.tmTheme rename to components/config/sublime/themes/nord.tmTheme diff --git a/sublime/themes/nyx-bold.tmTheme b/components/config/sublime/themes/nyx-bold.tmTheme similarity index 100% rename from sublime/themes/nyx-bold.tmTheme rename to components/config/sublime/themes/nyx-bold.tmTheme diff --git a/sublime/themes/one-dark.tmTheme b/components/config/sublime/themes/one-dark.tmTheme similarity index 100% rename from sublime/themes/one-dark.tmTheme rename to components/config/sublime/themes/one-dark.tmTheme diff --git a/sublime/themes/railsbase16-green-screen-dark.tmTheme b/components/config/sublime/themes/railsbase16-green-screen-dark.tmTheme similarity index 100% rename from sublime/themes/railsbase16-green-screen-dark.tmTheme rename to components/config/sublime/themes/railsbase16-green-screen-dark.tmTheme diff --git a/sublime/themes/solarized-dark.tmTheme b/components/config/sublime/themes/solarized-dark.tmTheme similarity index 100% rename from sublime/themes/solarized-dark.tmTheme rename to components/config/sublime/themes/solarized-dark.tmTheme diff --git a/sublime/themes/solarized-light.tmTheme b/components/config/sublime/themes/solarized-light.tmTheme similarity index 100% rename from sublime/themes/solarized-light.tmTheme rename to components/config/sublime/themes/solarized-light.tmTheme diff --git a/sublime/themes/subway-madrid.tmTheme b/components/config/sublime/themes/subway-madrid.tmTheme similarity index 100% rename from sublime/themes/subway-madrid.tmTheme rename to components/config/sublime/themes/subway-madrid.tmTheme diff --git a/sublime/themes/subway-moscow.tmTheme b/components/config/sublime/themes/subway-moscow.tmTheme similarity index 100% rename from sublime/themes/subway-moscow.tmTheme rename to components/config/sublime/themes/subway-moscow.tmTheme diff --git a/sublime/themes/two-dark.tmTheme b/components/config/sublime/themes/two-dark.tmTheme similarity index 100% rename from sublime/themes/two-dark.tmTheme rename to components/config/sublime/themes/two-dark.tmTheme diff --git a/sublime/themes/visual-studio-dark.tmTheme b/components/config/sublime/themes/visual-studio-dark.tmTheme similarity index 100% rename from sublime/themes/visual-studio-dark.tmTheme rename to components/config/sublime/themes/visual-studio-dark.tmTheme diff --git a/sublime/themes/zenburn.tmTheme b/components/config/sublime/themes/zenburn.tmTheme similarity index 100% rename from sublime/themes/zenburn.tmTheme rename to components/config/sublime/themes/zenburn.tmTheme From ad7986081c0f86faab58dffbd4ed1f0f87564ad0 Mon Sep 17 00:00:00 2001 From: ZzMzaw <89450172+ZzMzaw@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:20:13 +0200 Subject: [PATCH 08/10] Add pagination info to sections (#2653) * Add pagination info to get_section * Add documentation for pagination information * Stick to section properties `paginated` attributes removed --- components/content/src/ser.rs | 4 ++++ docs/content/documentation/templates/pages-sections.md | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/components/content/src/ser.rs b/components/content/src/ser.rs index 919d0d1bb..d77a43dd1 100644 --- a/components/content/src/ser.rs +++ b/components/content/src/ser.rs @@ -162,6 +162,8 @@ pub struct SerializingSection<'a> { backlinks: Vec>, generate_feeds: bool, transparent: bool, + paginate_by: &'a Option, + paginate_reversed: bool, } #[derive(Debug)] @@ -226,6 +228,8 @@ impl<'a> SerializingSection<'a> { subsections, translations, backlinks, + paginate_by: §ion.meta.paginate_by, + paginate_reversed: section.meta.paginate_reversed, } } } diff --git a/docs/content/documentation/templates/pages-sections.md b/docs/content/documentation/templates/pages-sections.md index 97f955961..1061796f4 100644 --- a/docs/content/documentation/templates/pages-sections.md +++ b/docs/content/documentation/templates/pages-sections.md @@ -112,8 +112,16 @@ backlinks: Array<{permalink: String, title: String?}>; generate_feeds: bool; // Whether this section is transparent. Taken from the front-matter if set transparent: bool; +// How many items per pager (if defined) +paginate_by: Number?; +// If items order is reversed in the pagination (defaults to false) +paginate_reversed: bool; ``` +Information about pagination is useful when using the `get_section` Tera function for which the `paginator` is not available. + +See [pagination template documentation](@/documentation/templates/pagination.md) for more information on the `paginator` variable. + ## Table of contents Both page and section templates have a `toc` variable that corresponds to an array of `Header`. From 2b5c3d0c257600455599a4975c786ee2c0b8c10f Mon Sep 17 00:00:00 2001 From: Jamie Dumont Date: Fri, 18 Oct 2024 18:28:11 +0100 Subject: [PATCH 09/10] Handle file events emitted by Nova on macOS (#2674) --- src/fs_utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fs_utils.rs b/src/fs_utils.rs index 9cd3da8a7..6530de437 100644 --- a/src/fs_utils.rs +++ b/src/fs_utils.rs @@ -35,6 +35,10 @@ pub type MeaningfulEvent = (PathBuf, PathBuf, SimpleFileSystemEventKind); /// return `None`. fn get_relevant_event_kind(event_kind: &EventKind) -> Option { match event_kind { + // Nova on macOS reports this as it's final event on change + EventKind::Modify(ModifyKind::Name(RenameMode::Any)) => { + Some(SimpleFileSystemEventKind::Modify) + } EventKind::Create(CreateKind::File) | EventKind::Create(CreateKind::Folder) => { Some(SimpleFileSystemEventKind::Create) } From ab0ad3347cb5e245d3834669b737317015062cf8 Mon Sep 17 00:00:00 2001 From: William Breathitt Gray Date: Wed, 6 Nov 2024 20:41:57 +0900 Subject: [PATCH 10/10] Improve accessibility by nesting bottom footnotes inside footer element (#2688) This adds semantic meaning to the footnotes organization and improves accessibility by aiding disabled users who rely on assistive devices such as screen readers which utilize semantic tags such as the footer element in order to navigate properly. The hr element is semantically defined as representing a paragraph-level thematic break. Now that the footnotes are descendants of the footer element, the hr element originally preceding the footnotes list is no longer necessary (footnotes are no longer paragraph-level content) and thus replaced. However, the footer element is given the class "footnotes" to allow for styling, so the following CSS could be used to provide a stylistically equivalent visible border separating the footnotes from the content if so desired: .footnotes { border-top: 2px groove gray; } Test snapshots are also updated to reflect the new footer elements. --- components/markdown/src/markdown.rs | 5 +++-- .../snapshots/markdown__markdown__tests__def_before_use.snap | 4 +++- .../markdown__markdown__tests__footnote_inside_footnote.snap | 4 +++- .../snapshots/markdown__markdown__tests__multiple_refs.snap | 4 +++- .../markdown__markdown__tests__reordered_footnotes.snap | 4 +++- .../markdown__markdown__tests__single_footnote.snap | 4 +++- .../tests/snapshots/markdown__github_style_footnotes.snap | 4 +++- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/components/markdown/src/markdown.rs b/components/markdown/src/markdown.rs index 16210b384..bcbca4799 100644 --- a/components/markdown/src/markdown.rs +++ b/components/markdown/src/markdown.rs @@ -304,7 +304,8 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec) { return; } - old_events.push(Event::Html("
                  \n".into())); + old_events + .push(Event::Html("
                  \n
                    \n".into())); // Step 2: retain only footnotes which was actually referenced footnotes.retain(|f| match f.first() { @@ -394,7 +395,7 @@ fn convert_footnotes_to_github_style(old_events: &mut Vec) { }); old_events.extend(footnotes); - old_events.push(Event::Html("
                  \n".into())); + old_events.push(Event::Html("
                \n\n".into())); } pub fn markdown_to_html( diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap b/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap index 698d689fc..39dca0a91 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__def_before_use.snap @@ -3,8 +3,10 @@ source: components/markdown/src/markdown.rs expression: html ---

                There is footnote definition?1

                -
                  +
                  +
                  1. It's before the reference.

                  +
                  diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap b/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap index 58a2d9b22..2572a62c6 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__footnote_inside_footnote.snap @@ -3,7 +3,8 @@ source: components/markdown/src/markdown.rs expression: html ---

                  This text has a footnote1

                  -
                    +
                    +
                    1. But the footnote has another footnote2.

                    2. @@ -11,3 +12,4 @@ expression: html

                      That's it.

                    +
                    diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap b/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap index d53e9ee33..bde7c95a7 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__multiple_refs.snap @@ -3,8 +3,10 @@ source: components/markdown/src/markdown.rs expression: html ---

                    This text has two1 identical footnotes1

                    -
                      + diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap b/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap index 9fddfea39..490f53ad0 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__reordered_footnotes.snap @@ -3,7 +3,8 @@ source: components/markdown/src/markdown.rs expression: html ---

                      This text has two1 footnotes2

                      -
                        +
                        +
                        1. But they are

                        2. @@ -11,3 +12,4 @@ expression: html

                          not sorted.

                        +
                        diff --git a/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap b/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap index 604489ab7..98761285a 100644 --- a/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap +++ b/components/markdown/src/snapshots/markdown__markdown__tests__single_footnote.snap @@ -3,8 +3,10 @@ source: components/markdown/src/markdown.rs expression: html ---

                        This text has a footnote1

                        -
                          +
                          +
                          1. But it is meaningless.

                          +
                          diff --git a/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap b/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap index 07d7fc5f6..56cf3e294 100644 --- a/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap +++ b/components/markdown/tests/snapshots/markdown__github_style_footnotes.snap @@ -8,7 +8,8 @@ expression: body

                          This text has two5 identical footnotes5

                          This text has a footnote6

                          Footnotes can also be referenced with identifiers8.

                          -
                            +