1401 Commits

Author SHA1 Message Date
Matt Wang
5dd80bf749
docs: exclude CODE_OF_CONDUCT, docker-compose, and Dockerfile (#1187)
Noticed that these files are in our final `_site` build, and they shouldn't be! Bite-sized PR to exclude those.
2023-03-14 17:20:22 -07:00
Matt Wang
1a22f052e9
Remove unused images (just-the-docs.png, search.svg) (#1107)
Noticed that we have some images in `assets/` that aren't linked-to from any part of the site. `just-the-docs.png` is used as an example for enabling an image header, but it's not actually called-to. `search.svg` doesn't exist at all (it was moved to an icon, but the original file was never deleted).
2023-03-14 17:18:50 -07:00
Matthew Wang
117195fb1c
Prep for v0.4.2 v0.4.2 2023-03-14 17:08:54 -07:00
Matt Wang
ac5c99c77c
Update CHANGELOG.md 2023-03-09 08:18:14 -08:00
Matt Wang
765954233a
Fix import order for setup.scss (#1184)
In the conversation for #1166, I noticed that the import order for `setup.scss` disagrees with our docs.

> In particular, the [docs for `setup.scss`](https://just-the-docs.com/docs/customization/#override-and-define-new-variables) reads:
> 
> > To define new SCSS variables, functions, or override existing theme variables, place SCSS code in `_sass/custom/setup.scss`
> 
> But, this is not true - `setup.scss` is loaded *before* all of the themes, so it doesn't override existing theme variables. 
> 
> In my opinion, the solution here is to move `setup.scss` after all the `color_scheme` SCSS. This way, `setup.scss` properly allows theme overrides. In addition, users who previously defined variables in `setup.scss` and then used them in their custom color schemes can shift those declarations to be entirely in the theme code.

This is a one-liner that fixes the behaviour to be in-line with what our docs state.
2023-03-09 08:16:41 -08:00
Matt Wang
19dbd776c1
Fix duplicate import of color_schemes (#1173)
This is a deceptively simple PR that stops the double import of `color_schemes`. With @pdmosses' stellar suggestion, it's a simple two-liner!

## interaction with #1166

This is a clean merge!

## path forward for default syntax highlighting

However, this leaves an interesting question: if the user doesn't provide syntax highlighting as part of their color scheme, should we include a default set (in this case, the light theme)?

Broadly, I see a few arguments:

1. if we don't provide defaults, we'll break color schemes that don't define their own syntax highlighting
2. if we do provide defaults, we could unnecessarily bloat the file size

I think 1 is more pernicious than 2. Thus, my suggested path forward is:

- for now, merge this
- in `v1.0`, separate these concerns properly, and force each color scheme to provide its own syntax highlighting CSS. Provide a default file for users to import with `@import` or `@use`[^1]. 

[^1]: Separately, we're using `!default` wrong; [looking at the docs](https://sass-lang.com/documentation/variables#default-values), we need to be using it with `@use` for the defaults to take effect. Since we're not doing that, `!default` isn't actually doing anything! This is why variable overrides aren't propagating the way they should be (and thus, users need to do a lot of duplication). Fixing this is probably a v1 item, though I'll have to think about it more.
2023-03-09 08:05:47 -08:00
Matt Wang
38a34af2c0
Remove unused dark syntax themes (#1192)
Quick follow-up to #1166; see https://github.com/just-the-docs/just-the-docs/pull/1166#discussion_r1130157584.
2023-03-09 08:05:13 -08:00
Matt Wang
cc9bead2e9
Update CHANGELOG.md 2023-03-08 15:22:49 -08:00
Matt Wang
9a0b518f0e
Update default theme code highlighting with Atom's One Light colors, consolidate theme variables (#1166)
This PR replaces the default light code highlighting theme with Atom's One Light theme colors. This should provide more visual similarity with our dark theme, and as a byproduct, fix some of the contrast issues from our current light theme.

In addition (different from the original purpose of this PR), this also moves theme variables from `variables.scss` to `light.scss`, which always gets loaded anyways.

To test, compare the [deploy preview's kitchen sink Python code](https://deploy-preview-1166--just-the-docs.netlify.app/docs/index-test/#more-code) to the current [`main` branch's code](https://just-the-docs.github.io/just-the-docs/docs/index-test/#more-code); you can also use the "Preview dark color scheme" button to see OneDarkJekyll in action.

Users can opt-in to the old theme with `legacy_light`. I've documented this in the "customization" page.

Closes #679.

## implementation

Feel free to skip this part.

To do this, I:

- forked [mgyongyosi/OneDarkJekyll](https://github.com/mgyongyosi/OneDarkJekyll) to our own organization, [OneLightJekyll](https://github.com/just-the-docs/OneLightJekyll)
- updated the code to be slightly more robust (e.g. not require installing to global path)
- replaced the `colors.less` with the one pulled from Atom's [one-light-syntax](https://github.com/atom/atom/tree/master/packages/one-light-syntax)
- updated the license notice to also include GitHub's work in Atom
- regenerated the file
- plopped it in our current theme code



## next steps

This is related to #1100. I wanted to make this PR easier to review, so I won't implement that just yet; once we merge this, I can push that PR through. It's also related to #1173; in a comment below, I've also outlined some potential future work.

After we merge this, I'll trigger a release soon. I think this next minor bump can be focused on color schemes, e.g. dark theme, theme switching, and some bugfixes.
2023-03-08 15:11:41 -08:00
Matt Wang
67d7465dbe
Update CHANGELOG.md 2023-03-07 18:41:37 -08:00
flyx
16fe752dbc
Add docs for using mermaid with AsciiDoc (#1182)
As discussed in #1174, this adds a documentation section to UI Components > Code > Mermaid that describes the usage of mermaid with AsciiDoc.

Regarding the comment on asciidoctor-diagram in my edits, I cannot stress enough how much pain this is to set up (this was the first thing I tried before switching to JTD's client-side mermaid support).  It basically pre-renders mermaid diagrams in a headless chromium browser. This requires manual configuration of Puppeteer, along with additional config for Jekyll to keep the images the extension creates. And when you managed to get the image on your site, it looks horrible. This is why I wrote „not recommended“.
2023-03-07 18:40:25 -08:00
Matt Wang
1999256809
Revert mermaid_config.js prettier-ignore comment (#1189)
I introduced a bug in #1172 --- there's an implicit requirement that the line in `mermaid_config.js` has either an expression or the start of a code block; a comment (and then a newline) is invalid.

(to maintain the ignore behaviour, I've instead moved it to the `.prettierignore`)

This one's on me -- I hadn't realized that the `prettier-ignore` affected this file. Given the relative urgency of this, going to merge this in.

Closes #1188.
2023-03-03 09:17:11 -08:00
Matt Wang
6a55d05f30
Moves .prettierrc to package.json (#1186)
Short and sweet PR that does exactly what the title says. Note that this only affects developers of our theme, and is a no-op on the rest of the codebase (including formatting) -- it's just moving a config file!

The nice benefits: higher precedence, and one less file (that can confuse users who are forking this repo).
2023-03-02 00:28:00 -08:00
Matt Wang
5f59793766
Upgrade to Stylelint 15 (#1185)
This is an internal change that only affects developers of our theme. This PR:

- **upgrades `Stylelint` to `v15`!**
    -  among other things, this leads to the deprecation of many stylistic rules, which overlap with Prettier
    - it also sees the addition of new rules that catch more errors, especially `declaration-property-value-no-unknown`!
- upgrades the accompanying standard config (the SCSS one extends the first-party one); this new config disables the deprecated rules that overlap with Prettier
- removes a now-unneeded plugin that disables overlapping rules
- moves the `stylelint` config object to `package.json` - now we have one less file (particularly important since people still clone this repo)

There were very few new changes; I combined one string that had a dangling `+` in an SCSS warning, and have temporarily disabled the `at-rule-empty-line-before` rule (which also picks up on SCSS `@includes`).
2023-03-02 00:22:34 -08:00
Matt Wang
56a2dc560a
Fix prettier usage (#1172)
After some discussion in #1166, I realized that our prettier workflow is somewhat broken! This PR fixes it, by:

- separating Stylelint & Prettier (and removing `stylelint-prettier`) to clearly separate linting versus formatting 
    - this is also helpful for the upcoming upgrading of Stylelint
- having Prettier ignore `assets/js/zzzz-search-data.json`; on `main`, `npm run format` fails because of this file (Prettier doesn't know how to interpret the front matter)
- change `npm test` to run both Stylelint and Prettier on CI (uses `npm-run-all` utility
    - had to add one `// prettier-ignore` in `_includes/mermaid_config.js`, which I think is reasonably placed
- removing an unused `script` (that doesn't work!)

This is a no-op on the site itself, just for our dev environment/CI.

Ref: https://github.com/just-the-docs/just-the-docs/pull/1166#discussion_r1110397592.

---

Separately, upgrading to Stylelint 15 will come with another interaction - the [deprecation of stylistic rules](https://stylelint.io/migration-guide/to-15#deprecated-stylistic-rules) + shift to Prettier should be nice!
2023-03-02 00:05:39 -08:00
Matthew Wang
1289f6866f
Prep for v0.4.1 v0.4.1 2023-02-23 15:20:08 -08:00
Matt Wang
6a2c602328
Update CHANGELOG.md 2023-02-23 15:09:31 -08:00
Dima
51e1c29021
Fix main content negative margin for viewports in [$md, $nav-width + $content-width] (#1177) 2023-02-23 15:07:42 -08:00
Matt Wang
b20acf0edb
Update CHANGELOG.md 2023-02-18 17:28:51 -08:00
flyx
fdf48d2fd3
Fix AsciiDoc code block styling (#1168)
These changes accommodate for some difference in the HTML structure AsciiDoc produces for source code listings:

 * proper padding for source code listings
 * proper vertical margin after source code listings
 * proper placement of the copy button if enabled

Closes #1163
2023-02-18 17:27:44 -08:00
Matt Wang
f8e93980b4
Update CHANGELOG.md 2023-02-17 14:53:34 -08:00
Matt Wang
a9d9354242
Remove unused OneDarkJekyll files (#1167)
Removes unused `OneDarkJekyll` files
2023-02-17 14:51:45 -08:00
Matt Wang
00cb3ba94b
Update CHANGELOG.md 2023-02-14 11:03:13 -08:00
Matt Wang
0484b45bfb
Readd jekyll-github-metadata plugin to site (#1108)
In my other cleaning, I also noticed:

- the contributors pane on the homepage is broken
- the following link to a repo page in the search docs is broken

<img width="762" alt="Screenshot 2023-01-03 at 6 41 49 PM" src="https://user-images.githubusercontent.com/14893287/210474679-bcb9af23-0a4e-4999-a0ec-f06d967ea726.png">

In particular, the generated HTML is

```html
<a href="/blob/main/assets/js/zzzz-search-data.json">this content</a>
```

Looking at the source code for both features

```html
<ul class="list-style-none">
{% for contributor in site.github.contributors %}
  <li class="d-inline-block mr-1">
     <a href="{{ contributor.html_url }}"><img src="{{ contributor.avatar_url }}" width="32" height="32" alt="{{ contributor.login }}"></a>
  </li>
{% endfor %}
</ul>
```

```md
[this content]({{ site.github.repository_url }}/blob/main/assets/js/zzzz-search-data.json).
```

It's clear that `site.github` is not being populated. This is controlled by the GitHub Metadata/[`jekyll-github-metadata`](http://jekyll.github.io/github-metadata/) plugin.

I'm not when this stopped working. If I had to guess, I think this is packaged as part of the `github-pages` gem; so, when the site moved off of it a while back, we never noticed this regression. This is the type of thing that can hopefully be caught by regression tests in the future.

This PR re-adds the plugin. I've opted to only add it to the `Gemfile` but not the `gemspec` so that it only affects our site. In other words, JtD does not have `jekyll-github-metadata` as a runtime dependency (since none of our theme code relies on it). Happy to change that if we'd like.

---

In the future, 

- short-term: I can write a filter that removes dependabot from our contributors
- longer-term: we could rewrite the "last edited on GitHub" feature to instead use `jekyll-github-metadata`. this would necessitate us to make it a runtime dependency, and it also wouldn't work as well for users of GitLab or other alternatives.
2023-02-14 11:00:18 -08:00
Matt Wang
27ae8d3e46
Add to CI matrix: windows, macOS; Ruby 2.7; allow later versions of bundler (#1165)
This PR:

- matricizes (?) the OS parameter: we now also test on `windows` and `macOS`
- matricizes the Ruby version parameter: we now also test on Ruby 2.7
- loosens the `.gemspec` requirement for `bundler` to allow things greater than `2.3.5`
    - interestingly, this is because the Ruby 2.7 container has a **later** version of bundler than the 3.1 one!

The last point makes this user-facing, and thus I'll trigger a release for this PR sometime soon.

These only apply to the `jekyll-build` job. Here, I think we have a broader obligation to support various use-cases (maybe they're deploying on GitLab, generating files locally, etc.); in contrast, the `github-pages` gem is used exclusively for deploying to GitHub Pages, so we should try to match that environment exactly.

This PR closes #1145.
2023-02-14 10:48:23 -08:00
Matt Wang
a812b37fcd
Add CI for github-pages gem builds (#1164)
This is a small PR that:

- adds a `fixtures/Gemfile-github-pages`, the minimum gemfile necessary to build the site
- adds a new Actions workflow to build the site with that gemfile

In the future, this should prevent issues like #1074, where we push a change that passes the `jekyll` CI but fails to build on `github-pages` (and its dependencies - which in this case, was an older version of ruby sass).

(to be honest - not super happy with the code duplication, but I also think we'll have different build matrices for the different versions, so I'm fine with this for now)

Part of (but does not close) #1145.
2023-02-14 10:07:00 -08:00
dependabot[bot]
f312da69d6
Bump prettier from 2.8.3 to 2.8.4 (#1158)
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.3 to 2.8.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.3...2.8.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 09:04:31 -08:00
Matthew Wang
dd1e80ae1c
Prep for v0.4.0: changelog, docs, gemspec bump v0.4.0 2023-02-05 16:20:14 -08:00
Matthew Wang
86dbc2d4d7
Prep for v0.4.0.rc5; update gemspec and CHANGELOG v0.4.0.rc5 2023-02-05 15:14:02 -08:00
Matt Wang
c7c99992f9
Update CHANGELOG.md 2023-02-05 15:00:01 -08:00
Matt Wang
8894630659
Fix copy code button interaction with kramdown line numbers (#1143)
Co-authored-by: Simone <26844016+simonebortolin@users.noreply.github.com>
2023-02-05 14:58:56 -08:00
Matt Wang
4a7fbbca92
Update CHANGELOG.md 2023-02-05 14:53:21 -08:00
Christian Bäuerlein
b2bbdb7040
Add configuration key to load a local version of mermaid (#1153)
Hi there!

Thank you for the great theme! I am a happy user and was delighted to see that mermaid support has landed.

In some cases the usage of jsDelivr might not be possible for technical or compliance reasons.

This commit adds a second way to include the mermaid lib by specifying a path in the mermaid config. This way a local version of the lib can be used.

It should be fully backwards compatible, not requiring any action by users that already include the lib from the CDN.

I already added some documentation, but I am also happy to extend this, if this change is generally well-received.

Cheers,
Christian
2023-02-05 14:51:48 -08:00
Matt Wang
cf72c436d9
Update CHANGELOG.md 2023-01-29 17:51:17 -08:00
M. R. McCormick
6cdd4f76b5
Fix dark theme's code block background, line number colors (#1124)
When customizing `$code-background-color` in `dark.scss`, the result is a multi-color background. (see https://github.com/just-the-docs/just-the-docs/issues/1121#issuecomment-1374976843)

This makes OneDarkJekyll code block colors the same as the specified `$code-background-color`, and uses the `$default-body-color` as the line number text color, which can otherwise be invisible due to the default being black and is hard to see on a very dark code block background.
2023-01-29 17:50:02 -08:00
Matt Wang
c13a5d2cdf
Update CHANGELOG.md 2023-01-29 17:49:20 -08:00
Matt Wang
5f91e326c7
docs: label new features introduced in v0.4 (#1138)
In #1058, I noted:

> Tangentially related work:
> ...
> - better annotate new features (motivated by writing these docs)
>     - we should add "New" to new features :) 
>     - we should note when a feature was introduced (I think this is a core part of most software documentation)
>     - we should annotate things that are "Advanced" in so far as the average Just the Docs user will not use them / they require significant Jekyll knowledge
> 

This came up again in https://github.com/just-the-docs/just-the-docs/discussions/1136#discussioncomment-4716253, so I think it's best for us to resolve this sooner rather than later.

This PR is me doing that. I:

- have added a headings-level "New" label to every new heading introduced since `v0.3`
- added, when possible, inline YAML comments when new configuration options have been introduced

I did this by scanning through the CHANGELOG and selecting each feature that is either tagged with `Add` and has documentation.

I may have also missed any new features, so some double-checking would be helpful!
2023-01-29 17:48:22 -08:00
Flo
975aec0791
ci: Add workflow for updating jekyll-anchor-headings automatically (#1075) 2023-01-23 23:08:41 +01:00
Matt Wang
3ce3dc74e0
Update CHANGELOG.md 2023-01-23 11:00:48 -08:00
Dale Phurrough
c7bdfe5456
docs: clarify steps to add custom lunr index code (#1139) 2023-01-23 10:57:35 -08:00
Peter Mosses
81d7e13277
Docs: add a migration guide (#1059)
The migration guide is intended to help those using Just the Docs (as a theme or a remote theme) switch from v0.3.3 to v0.4.0.

Co-authored-by: Matt Wang <matt@matthewwang.me>
2023-01-23 10:25:40 -08:00
Matt Wang
3de6c589aa
Update CHANGELOG.md 2023-01-22 23:36:24 -08:00
M. R. McCormick
3335b9791d
Exclude images from being bundled with gem (#1142)
Co-authored-by: m-r-mccormick <m-r-mccormick@users.noreply.github.com>
2023-01-22 23:35:21 -08:00
Matt Wang
73a7e7cb33
Update CHANGELOG.md 2023-01-18 11:17:01 -08:00
Matt Wang
d423c96d7a
Add new _sass/custom/setup.scss for variable definition (#1135)
This is an alternative PR that resolves #1011. Unlike #1013, this PR defines a *new* SASS file, `_sass/custom/setup.scss`, specifically designed for new custom variables (and other SASS-only constructs). It's imported after our `support` SASS files are (functions, variables), but otherwise is imported before all other files (ex, when CSS is emitted).

So, custom callout colors can now be defined in this file. I also move the custom callout colors present in `custom.scss` to the right location.

I've added some docs that briefly explain how to use the feature. Feedback is welcome!

---

As an aside, I chose not to add a `_includes/css` file that imports this, and then import that file. I think that's only necessary if we're trying to render liquid somehow in the SASS file; since we're not trying to do that for `setup.scss`, I've opted to not include it. If we think this is relevant, I can re-add it.

Co-authored-by: Peter Mosses <18308236+pdmosses@users.noreply.github.com>
2023-01-18 11:13:30 -08:00
dependabot[bot]
eeb89e56f0
Merge pull request #1134 from just-the-docs/dependabot/npm_and_yarn/prettier-2.8.3 2023-01-16 10:27:03 +00:00
dependabot[bot]
1de6260d57
Bump prettier from 2.8.2 to 2.8.3
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.2 to 2.8.3.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.2...2.8.3)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 10:13:53 +00:00
Matt Wang
70e55f1d7b
Update CHANGELOG.md 2023-01-13 19:09:57 -08:00
Dale Phurrough
7a01ef1a59
add options for custom lunr Liquid and JS code (#1068)
This is a prototype for review and discussion. My use and testing of this PR is on top of 6d9d41359c46882d9b64a446d5a83fac5b3e20a7. The changes are trival to rebase to `main` and I'm happy to do so if this prototype moves forward.


* Feature request details in linked issue, fixes just-the-docs/just-the-docs#1067
* I welcome feedback and all discussion
* A draft doc site of mine using this PR is at https://docs.hidale.com/

To use the prototype, the two include files need to be customized. Here are mine from the draft website 9c0d836408

Co-authored-by: Matt Wang <matt@matthewwang.me>
2023-01-13 19:08:33 -08:00
Matt Wang
5e7a481258
Update CHANGELOG.md 2023-01-13 15:59:06 -08:00