toolkit for mdBook [mirror of my GitHub repo] docs.tonywu.dev/mdbookkit/
permalinks rust-analyzer mdbook
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: update workflows (WIP)

Tony Wu ee708bec 643745df

+31 -80
+17 -8
.github/workflows/bin.yml
··· 87 87 .bin/ 88 88 target/ 89 89 90 - - name: Build binaries 90 + - name: Build mdbook-rustdoc-links 91 + uses: taiki-e/upload-rust-binary-action@v1 92 + with: 93 + target: ${{ matrix.target }} 94 + bin: mdbook-rustdoc-links 95 + tar: unix 96 + zip: windows 97 + codesign: "-" 98 + token: ${{ secrets.GITHUB_TOKEN }} 99 + dry-run: ${{ github.event_name != 'release' }} 100 + 101 + - name: Build mdbook-permalinks 91 102 uses: taiki-e/upload-rust-binary-action@v1 92 103 with: 93 104 target: ${{ matrix.target }} 94 - bin: mdbook-rustdoc-link,mdbook-link-forever 95 - features: rustdoc-link,link-forever 96 - archive: mdbookkit-$target 105 + bin: mdbook-permalinks 97 106 tar: unix 98 107 zip: windows 99 108 codesign: "-" ··· 103 112 - uses: actions/upload-artifact@v4 104 113 with: 105 114 path: | 106 - target/${{ matrix.target }}/release/mdbook-rustdoc-link 107 - target/${{ matrix.target }}/release/mdbook-link-forever 108 - target/${{ matrix.target }}/release/mdbook-rustdoc-link.exe 109 - target/${{ matrix.target }}/release/mdbook-link-forever.exe 115 + target/${{ matrix.target }}/release/mdbook-rustdoc-links 116 + target/${{ matrix.target }}/release/mdbook-rustdoc-links.exe 117 + target/${{ matrix.target }}/release/mdbook-permalinks 118 + target/${{ matrix.target }}/release/mdbook-permalinks.exe 110 119 name: ${{ matrix.target }} 111 120 if-no-files-found: warn 112 121 retention-days: 1
+6 -41
.github/workflows/ci.yml
··· 19 19 workflow_dispatch: 20 20 21 21 env: 22 - CARGO_TERM_COLOR: "always" 22 + CARGO_TERM_COLOR: always 23 + MDBOOK_LOG: debug 23 24 RUST_BACKTRACE: "1" 24 - RUST_LOG: "info" 25 25 26 26 concurrency: 27 27 group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} ··· 61 61 - uses: dtolnay/rust-toolchain@master 62 62 with: 63 63 toolchain: stable 64 + components: rust-src # speeds up rust-analyzer indexing 64 65 65 66 - uses: cargo-bins/cargo-binstall@b9bf4400702f721d469eec4d280125f650c85638 66 67 ··· 92 93 cargo run --package util-rust-analyzer -- download 93 94 94 95 - name: Build tests 95 - run: cargo test --all-features --no-run 96 + run: cargo test --no-run 96 97 97 98 - name: Test 98 - run: cargo test --all-features --no-fail-fast -- --include-ignored 99 + run: cargo test --no-fail-fast -- --include-ignored 99 100 100 101 outputs: 101 102 cache-primary-key: ${{steps.cache.outputs.primary-key}} 102 103 cache-restore-key: ${{steps.cache.outputs.restore-key}} 103 104 cache-path: ${{steps.cache.outputs.path}} 104 105 105 - build_features: 106 - name: Build features 107 - 108 - needs: 109 - - test 110 - 111 - strategy: 112 - matrix: 113 - features: 114 - - rustdoc-link 115 - - lib-rustdoc-link,common-logger 116 - - lib-rustdoc-link 117 - - link-forever 118 - - lib-link-forever,common-logger 119 - - lib-link-forever 120 - fail-fast: false 121 - 122 - runs-on: ubuntu-latest 123 - 124 - steps: 125 - - uses: actions/checkout@v4 126 - with: 127 - fetch-depth: 0 128 - 129 - - uses: dtolnay/rust-toolchain@master 130 - with: 131 - toolchain: stable 132 - 133 - - uses: actions/cache/restore@v4 134 - with: 135 - path: ${{needs.test.outputs.cache-path}} 136 - key: ${{ needs.test.outputs.cache-primary-key }} 137 - restore-keys: ${{ needs.test.outputs.cache-restore-key }} 138 - 139 - - run: cargo build --features ${{ matrix.features }} 140 - 141 106 test_rustdoc_link_ra: 142 107 name: (rustdoc-link) Test RA 143 108 ··· 173 138 RA_VERSION: ${{ matrix.ra-version }} 174 139 175 140 - name: Test 176 - run: cargo test --features rustdoc-link 141 + run: cargo test --package mdbook-rustdoc-links --no-fail-fast -- --include-ignored
+2 -26
.github/workflows/docs.yml
··· 9 9 10 10 env: 11 11 CARGO_TERM_COLOR: always 12 + MDBOOK_LOG: debug 12 13 13 14 concurrency: 14 15 group: ${{ github.workflow }}-${{ github.ref }} ··· 59 60 60 61 - run: cargo bin mdbook build 61 62 working-directory: docs 62 - env: 63 - RUST_LOG: info 64 63 65 - - run: cargo run --package util-mdbook-socials -- . 64 + - run: cargo run -- postprocess 66 65 working-directory: docs 67 - env: 68 - RUST_LOG: info 69 66 70 67 - uses: actions/upload-pages-artifact@v3 71 68 with: 72 69 path: docs/dist 73 - 74 - deploy: 75 - name: Deploy 76 - runs-on: ubuntu-latest 77 - 78 - needs: build 79 - 80 - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'release' && !github.event.release.prerelease) && github.repository_owner == 'tonywu6' 81 - 82 - permissions: 83 - pages: write 84 - id-token: write 85 - 86 - environment: 87 - name: github-pages 88 - url: ${{ steps.deployment.outputs.page_url }} 89 - 90 - steps: 91 - - name: Deploy to GitHub Pages 92 - id: deployment 93 - uses: actions/deploy-pages@v4
+1
crates/mdbookkit/src/testing.rs
··· 116 116 .tap_mut(|s| { 117 117 s.set_filters(vec![ 118 118 (r"file:///[A-Z]:/", "file:///"), // windows paths 119 + (r"[A-Z]:\\", "/"), // windows paths 119 120 (r"(?m)^(\s+)\d{1} ", "$1 "), // miette line numbers 120 121 (r"(?m)^(\s+)\d{2} ", "$1 "), 121 122 (r"(?m)^(\s+)\d{3} ", "$1 "),
+5 -5
docs/bin/postprocess.rs
··· 14 14 use serde::Deserialize; 15 15 use serde_json::json; 16 16 use tap::{Pipe, Tap}; 17 - use tracing::{debug, error, info, info_span}; 17 + use tracing::{debug, error, info, info_span, trace}; 18 18 use url::Url; 19 19 20 20 use mdbookkit::{error::OnWarning, url::UrlFromPath}; ··· 168 168 let title = suffix.iter().fold(og_title.clone(), |mut out, suffix| { 169 169 write!(&mut out, " | {suffix}").and(Ok(out)).unwrap() 170 170 }); 171 - debug!(title); 171 + trace!(title); 172 172 elem.set_inner_content(&title, ContentType::Text); 173 173 Ok(()) 174 174 }), ··· 186 186 let img = image::open(src)?; 187 187 elem.set_attribute("width", &img.width().to_string())?; 188 188 elem.set_attribute("height", &img.height().to_string())?; 189 - debug!(?elem); 189 + trace!(?elem); 190 190 Ok(()) 191 191 }), 192 192 element!(r#"img[src^="https://img.shields.io/"]"#, |elem| { 193 193 elem.set_attribute("height", "20")?; 194 194 elem.set_attribute("fetchpriority", "low")?; 195 - debug!(?elem); 195 + trace!(?elem); 196 196 Ok(()) 197 197 }), 198 198 element!(r#"meta[property^="og:"]"#, |elem| { ··· 230 230 elem.set_attribute("target", "_blank").unwrap(); 231 231 elem.set_attribute("rel", "noreferrer").unwrap(); 232 232 } 233 - debug!(?elem); 233 + trace!(?elem); 234 234 Ok(()) 235 235 }), 236 236 ],