diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..860e06296e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,45 @@ +name: Bug Report +description: Create a report to help us improve +labels: ["C-bug"] +body: + - type: markdown + attributes: + value: Thanks for filing a 🐛 bug report 😄! + - type: textarea + id: problem + attributes: + label: Problem + description: > + Please provide a clear and concise description of what the bug is, + including what currently happens and what you expected to happen. + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps + description: Please list the steps to reproduce the bug. + placeholder: | + 1. + 2. + 3. + - type: textarea + id: possible-solutions + attributes: + label: Possible Solution(s) + description: > + Not obligatory, but suggest a fix/reason for the bug, + or ideas how to implement the addition or change. + - type: textarea + id: notes + attributes: + label: Notes + description: Provide any additional notes that might be helpful. + - type: textarea + id: version + attributes: + label: Version + description: > + Please paste the output of running `mdbook --version` or which version + of the library you are using. + render: text diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..179fccd5a2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,28 @@ +name: Enhancement +description: Suggest an idea for enhancing mdBook +labels: ["C-enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for filing a 🙋 feature request 😄! + - type: textarea + id: problem + attributes: + label: Problem + description: > + Please provide a clear description of your use case and the problem + this feature request is trying to solve. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Proposed Solution + description: > + Please provide a clear and concise description of what you want to happen. + - type: textarea + id: notes + attributes: + label: Notes + description: Provide any additional context or information that might be helpful. diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000000..675e8d5e23 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,24 @@ +name: Question +description: Have a question on how to use mdBook? +labels: ["C-question"] +body: + - type: markdown + attributes: + value: | + Got a question on how to do something with mdBook? + - type: textarea + id: question + attributes: + label: Question + description: > + Enter your question here. Please try to provide as much detail as possible. + validations: + required: true + - type: textarea + id: version + attributes: + label: Version + description: > + Please paste the output of running `mdbook --version` or which version + of the library you are using. + render: text diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc01f5b5ce..5543b37336 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,26 +3,46 @@ on: release: types: [created] +defaults: + run: + shell: bash + +permissions: + contents: write + jobs: release: name: Deploy Release runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + target: + - aarch64-unknown-linux-musl + - x86_64-unknown-linux-gnu + - x86_64-unknown-linux-musl + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + include: + - target: aarch64-unknown-linux-musl + os: ubuntu-20.04 + - target: x86_64-unknown-linux-gnu + os: ubuntu-20.04 + - target: x86_64-unknown-linux-musl + os: ubuntu-20.04 + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-pc-windows-msvc + os: windows-latest steps: - uses: actions/checkout@master - - name: Install hub - run: ci/install-hub.sh ${{ matrix.os }} - shell: bash - name: Install Rust - run: ci/install-rust.sh stable - shell: bash - - name: Build and deploy artifacts + run: ci/install-rust.sh stable ${{ matrix.target }} + - name: Build asset + run: ci/make-release-asset.sh ${{ matrix.os }} ${{ matrix.target }} + - name: Update release with new asset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ci/make-release.sh ${{ matrix.os }} - shell: bash + run: gh release upload $MDBOOK_TAG $MDBOOK_ASSET pages: name: GitHub Pages runs-on: ubuntu-latest @@ -40,3 +60,14 @@ jobs: curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy cd guide/book /tmp/deploy + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust (rustup) + run: rustup update stable --no-self-update && rustup default stable + - name: Publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish --no-verify diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfd114cac5..bfd2da2f7c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,7 @@ name: CI on: - # Only run when merging to master, or open/synchronize/reopen a PR. - push: - branches: - - master pull_request: + merge_group: jobs: test: @@ -30,15 +27,15 @@ jobs: os: windows-latest rust: stable - build: msrv - os: ubuntu-latest - # sync MSRV with docs: guide/src/guide/installation.md - rust: 1.54.0 + os: ubuntu-20.04 + # sync MSRV with docs: guide/src/guide/installation.md and Cargo.toml + rust: 1.70.0 steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - name: Install Rust run: bash ci/install-rust.sh ${{ matrix.rust }} - name: Build and run tests - run: cargo test + run: cargo test --locked - name: Test no default run: cargo test --no-default-features @@ -46,7 +43,24 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - name: Install Rust run: rustup update stable && rustup default stable && rustup component add rustfmt - run: cargo fmt --check + + # The success job is here to consolidate the total success/failure state of + # all other jobs. This job is then included in the GitHub branch protection + # rule which prevents merges unless all other jobs are passing. This makes + # it easier to manage the list of jobs via this yml file and to prevent + # accidentally adding new jobs without also updating the branch protections. + success: + name: Success gate + if: always() + needs: + - test + - rustfmt + runs-on: ubuntu-latest + steps: + - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' + - name: Done + run: exit 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 686004c5db..8a515bc5cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,232 @@ # Changelog +## mdBook 0.4.36 +[v0.4.35...v0.4.36](https://github.com/rust-lang/mdBook/compare/v0.4.35...v0.4.36) + +### Added +- Added Nim to the default highlighted languages. + [#2232](https://github.com/rust-lang/mdBook/pull/2232) +- Added a small indicator for the sidebar resize handle. + [#2209](https://github.com/rust-lang/mdBook/pull/2209) + +### Changed +- Updated dependencies. MSRV raised to 1.70.0. + [#2173](https://github.com/rust-lang/mdBook/pull/2173) + [#2250](https://github.com/rust-lang/mdBook/pull/2250) + [#2252](https://github.com/rust-lang/mdBook/pull/2252) + +### Fixed +- Fixed blank column in print page when the sidebar was visible. + [#2235](https://github.com/rust-lang/mdBook/pull/2235) +- Fixed indentation of code blocks when Javascript is disabled. + [#2162](https://github.com/rust-lang/mdBook/pull/2162) +- Fixed a panic when `mdbook serve` or `mdbook watch` were given certain kinds of paths. + [#2229](https://github.com/rust-lang/mdBook/pull/2229) + +## mdBook 0.4.35 +[v0.4.34...v0.4.35](https://github.com/rust-lang/mdBook/compare/v0.4.34...v0.4.35) + +### Added +- Added the `book.text-direction` setting for explicit support for right-to-left languages. + [#1641](https://github.com/rust-lang/mdBook/pull/1641) +- Added `rel=prefetch` to the "next" links to potentially improve browser performance. + [#2168](https://github.com/rust-lang/mdBook/pull/2168) +- Added a `.warning` CSS class which is styled for displaying warning blocks. + [#2187](https://github.com/rust-lang/mdBook/pull/2187) + +### Changed +- Better support of the sidebar when JavaScript is disabled. + [#2175](https://github.com/rust-lang/mdBook/pull/2175) + +## mdBook 0.4.34 +[v0.4.33...v0.4.34](https://github.com/rust-lang/mdBook/compare/v0.4.33...v0.4.34) + +### Fixed +- Fixed file change watcher failing on macOS with a large number of files. + [#2157](https://github.com/rust-lang/mdBook/pull/2157) + +## mdBook 0.4.33 +[v0.4.32...v0.4.33](https://github.com/rust-lang/mdBook/compare/v0.4.32...v0.4.33) + +### Added +- The `color-scheme` CSS property is now set based on the light/dark theme, which applies some slight color differences in browser elements like scroll bars on some browsers. + [#2134](https://github.com/rust-lang/mdBook/pull/2134) + +### Fixed +- Fixed watching of extra-watch-dirs when not running in the book root directory. + [#2146](https://github.com/rust-lang/mdBook/pull/2146) +- Reverted the dependency update to the `toml` crate (again!). This was an unintentional breaking change in 0.4.32. + [#2021](https://github.com/rust-lang/mdBook/pull/2021) +- Changed macOS change notifications to use the kqueue implementation which should fix some issues with repeated rebuilds when a file changed. + [#2152](https://github.com/rust-lang/mdBook/pull/2152) +- Don't set a background color in the print page for code blocks in a header. + [#2150](https://github.com/rust-lang/mdBook/pull/2150) + +## mdBook 0.4.32 +[v0.4.31...v0.4.32](https://github.com/rust-lang/mdBook/compare/v0.4.31...v0.4.32) + +### Fixed +- Fixed theme-color meta tag not syncing with the theme. + [#2118](https://github.com/rust-lang/mdBook/pull/2118) + +### Changed +- Updated all dependencies. + [#2121](https://github.com/rust-lang/mdBook/pull/2121) + [#2122](https://github.com/rust-lang/mdBook/pull/2122) + [#2123](https://github.com/rust-lang/mdBook/pull/2123) + [#2124](https://github.com/rust-lang/mdBook/pull/2124) + [#2125](https://github.com/rust-lang/mdBook/pull/2125) + [#2126](https://github.com/rust-lang/mdBook/pull/2126) + +## mdBook 0.4.31 +[v0.4.30...v0.4.31](https://github.com/rust-lang/mdBook/compare/v0.4.30...v0.4.31) + +### Fixed +- Fixed menu border render flash during page navigation. + [#2101](https://github.com/rust-lang/mdBook/pull/2101) +- Fixed flicker setting sidebar scroll position. + [#2104](https://github.com/rust-lang/mdBook/pull/2104) +- Fixed compile error with proc-macro2 on latest Rust nightly. + [#2109](https://github.com/rust-lang/mdBook/pull/2109) + +## mdBook 0.4.30 +[v0.4.29...v0.4.30](https://github.com/rust-lang/mdBook/compare/v0.4.29...v0.4.30) + +### Added +- Added support for heading attributes. + Attributes are specified in curly braces just after the heading text. + An HTML ID can be specified with `#` and classes with `.`. + For example: `## My heading {#custom-id .class1 .class2}` + [#2013](https://github.com/rust-lang/mdBook/pull/2013) +- Added support for hidden code lines for languages other than Rust. + The `output.html.code.hidelines` table allows you to define the prefix character that will be used to hide code lines based on the language. + [#2093](https://github.com/rust-lang/mdBook/pull/2093) + +### Fixed +- Fixed a few minor markdown rendering issues. + [#2092](https://github.com/rust-lang/mdBook/pull/2092) + +## mdBook 0.4.29 +[v0.4.28...v0.4.29](https://github.com/rust-lang/mdBook/compare/v0.4.28...v0.4.29) + +### Changed +- Built-in fonts are no longer copied when `fonts/fonts.css` is overridden in the theme directory. + Additionally, the warning about `copy-fonts` has been removed if `fonts/fonts.css` is specified. + [#2080](https://github.com/rust-lang/mdBook/pull/2080) +- `mdbook init --force` now skips all interactive prompts as intended. + [#2057](https://github.com/rust-lang/mdBook/pull/2057) +- Updated dependencies + [#2063](https://github.com/rust-lang/mdBook/pull/2063) + [#2086](https://github.com/rust-lang/mdBook/pull/2086) + [#2082](https://github.com/rust-lang/mdBook/pull/2082) + [#2084](https://github.com/rust-lang/mdBook/pull/2084) + [#2085](https://github.com/rust-lang/mdBook/pull/2085) + +### Fixed +- Switched from the `gitignore` library to `ignore`. This should bring some improvements with gitignore handling. + [#2076](https://github.com/rust-lang/mdBook/pull/2076) + +## mdBook 0.4.28 +[v0.4.27...v0.4.28](https://github.com/rust-lang/mdBook/compare/v0.4.27...v0.4.28) + +### Changed +- The sidebar is now shown on wide screens when localstorage is disabled. + [#2017](https://github.com/rust-lang/mdBook/pull/2017) +- Preprocessors are now run with `mdbook test`. + [#1986](https://github.com/rust-lang/mdBook/pull/1986) + +### Fixed +- Fixed regression in 0.4.26 that prevented the title bar from scrolling properly on smaller screens. + [#2039](https://github.com/rust-lang/mdBook/pull/2039) + +## mdBook 0.4.27 +[v0.4.26...v0.4.27](https://github.com/rust-lang/mdBook/compare/v0.4.26...v0.4.27) + +### Changed +- Reverted the dependency update to the `toml` crate. This was an unintentional breaking change in 0.4.26. + [#2021](https://github.com/rust-lang/mdBook/pull/2021) + +## mdBook 0.4.26 +[v0.4.25...v0.4.26](https://github.com/rust-lang/mdBook/compare/v0.4.25...v0.4.26) + +**The 0.4.26 release has been yanked due to an unintentional breaking change.** + +### Changed +- Removed custom scrollbars for webkit browsers + [#1961](https://github.com/rust-lang/mdBook/pull/1961) +- Updated some dependencies + [#1998](https://github.com/rust-lang/mdBook/pull/1998) + [#2009](https://github.com/rust-lang/mdBook/pull/2009) + [#2011](https://github.com/rust-lang/mdBook/pull/2011) +- Fonts are now part of the theme. + The `output.html.copy-fonts` option has been deprecated. + To define custom fonts, be sure to define `theme/fonts.css`. + [#1987](https://github.com/rust-lang/mdBook/pull/1987) + +### Fixed +- Fixed overflow viewport issue with mobile Safari + [#1994](https://github.com/rust-lang/mdBook/pull/1994) + +## mdBook 0.4.25 +[e14d381...1ba74a3](https://github.com/rust-lang/mdBook/compare/e14d381...1ba74a3) + +### Fixed +- Fixed a regression where `mdbook test -L deps path-to-book` would not work. + [#1959](https://github.com/rust-lang/mdBook/pull/1959) + +## mdBook 0.4.24 +[eb77083...8767ebf](https://github.com/rust-lang/mdBook/compare/eb77083...8767ebf) + +### Fixed +- The precompiled linux-gnu mdbook binary available on [GitHub Releases](https://github.com/rust-lang/mdBook/releases) inadvertently switched to a newer version of glibc. This release goes back to an older version that should be more compatible on older versions of Linux. + [#1955](https://github.com/rust-lang/mdBook/pull/1955) + +## mdBook 0.4.23 +[678b469...68a75da](https://github.com/rust-lang/mdBook/compare/678b469...68a75da) + +### Changed +- Updated all dependencies + [#1951](https://github.com/rust-lang/mdBook/pull/1951) + [#1952](https://github.com/rust-lang/mdBook/pull/1952) + [#1844](https://github.com/rust-lang/mdBook/pull/1844) +- Updated minimum Rust version to 1.60. + [#1951](https://github.com/rust-lang/mdBook/pull/1951) + +### Fixed +- Fixed a regression where playground code was missing hidden lines, preventing it from compiling correctly. + [#1950](https://github.com/rust-lang/mdBook/pull/1950) + +## mdBook 0.4.22 +[40c06f5...4844f72](https://github.com/rust-lang/mdBook/compare/40c06f5...4844f72) + +### Added +- Added a `--chapter` option to `mdbook test` to specify a specific chapter to test. + [#1741](https://github.com/rust-lang/mdBook/pull/1741) +- Added CSS styling for `` tags. + [#1906](https://github.com/rust-lang/mdBook/pull/1906) +- Added pre-compiled binaries for `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl` (see [Releases](https://github.com/rust-lang/mdBook/releases)). + [#1862](https://github.com/rust-lang/mdBook/pull/1862) +- Added `build.extra-watch-dirs` which is an array of additional directories to watch for changes when running `mdbook serve`. + [#1884](https://github.com/rust-lang/mdBook/pull/1884) + +### Changed +- Removed the `type="text/javascript"` attribute from ` + {{/if}} - + +
- - - + + - + + +
{{> header}} -