Skip to content

Conversation

@lazarusA
Copy link

@lazarusA lazarusA commented Apr 7, 2024

Take a look at the preview and test the navigation and search capabilities:

https://lazarusa.github.io/JuliaDocs/

I just wanna to share how the Julia docs could look like with vitepress. If this is something worth of consideration, please help 😄 (easter holidays are over).

Some issues.

  • The last steps of deployment are really cumbersome and will require considerable time from my side to figured out.
  • Some dead links (not many ~10)
  • styling issues (colour, landing page, etc...). Specially landing page, I'm still not happy about it.

PRs for styling at https://github.com/lazarusA/JuliaDocs or here in this PR.

@lazarusA lazarusA marked this pull request as draft April 7, 2024 12:33
@Zentrik
Copy link
Member

Zentrik commented Apr 7, 2024

Btw the codeblocks seem to be a bit too big on mobile, e.g.

Screenshot_2024-04-07-14-55-06-86_3aea4af51f236e4932235fdada7d1643

@avik-pal
Copy link
Member

avik-pal commented Apr 7, 2024

I think it is the box that is incorrectly scaled (pretty much my fault). While expanding the docs, I had written a custom div element to surround the docs with a border, but I think the margins for that were hardcoded.

We could take a look at the Documenter.jl reference div and adapt it for vitepress.

@avik-pal
Copy link
Member

avik-pal commented Apr 7, 2024

image

A typo here? -- "Julia's"

@lazarusA
Copy link
Author

lazarusA commented Apr 7, 2024

image

A typo here? -- "Julia's"

yeah, I changed all Julia's due to a parsing error at some point. This one is hard coded, hence once the automatic sidebar is correctly implemented, it should be fixed 😓 .

Copy link
Contributor

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not taking a stance on the UI/UX, but I do want to make a couple of maintenance points:

  • One of the core principles of Documenter is that the default writer is what the language manual uses. This ensures consistency across the ecosystem. So this should only be merged once it's integrated into Documenter.

  • Not really sure why we have the package.json and .vitepress directory here? The build should be seamless (i.e. that you don't configure anything outside of the makedocs call). It should also not require any external dependencies to be configured (i.e. Node, which I think this currently needs?). Both should be pretty solvable though -- any temporary generator-specific files can be put into a temporary directory (like with LaTeXWriter) and externals deps should just be handled via JLLs.

For me, these would be the hard requirements for switching. Also, I know this is currently WIP and a demo, and so maybe the solutions are already on the roadmap 🙂

Comment on lines +27 to +31
::: danger

This is a fork from the original repo. Please visit the [official website](https://julialang.org).

:::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not work, since this is not valid Julia Markdown (well, it's valid, but should just render as text). And so if VitePress renders this, that's a bit of a problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is vitepress specific https://vitepress.dev/guide/markdown#custom-containers, but the default admonitions also work see LuxDL/DocumenterVitepress.jl#22

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my experience with DimensionalData.jl this extra syntax is the best thing about vitepress, this is also how you make tabbed sections with very minimal work.

Comment on lines +1 to +25
```@raw html
---
layout: home
hero:
text: "The Julia Programming Language"
image:
light:
src: /logo.svg
alt: julia
dark:
src: /logo-dark.svg
alt: julia
actions:
- theme: brand
text: Getting Started
link: /manual/getting-started
- theme: alt
text: View on Github
link: https://github.com/JuliaLang/julia
- theme: brand
text: Sponsor
link: https://github.com/sponsors/julialang
---
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is.. wrong? It's not HTML. I guess we could have an @raw vitepress maybe. But having to hack this information in like this seems wrong regardless. Seems like it should maybe be an at-meta block? That would require adding some interfaces to Documenter I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually YAML, but a general interface for arbitrary front matter would be pretty great!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps

Frontmatter = """
my raw frontmatter here...
"""

might work?

Comment on lines +320 to +321
read as: `<cond> *and then* <statement>`). Similarly, instead of `if ! <cond> <statement> end`,
one can write `<cond> || <statement>` (which could be read as: `<cond> *or else* <statement>`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be like this I think?

Suggested change
read as: `<cond> *and then* <statement>`). Similarly, instead of `if ! <cond> <statement> end`,
one can write `<cond> || <statement>` (which could be read as: `<cond> *or else* <statement>`).
read as: `<cond>` *and then* `<statement>`). Similarly, instead of `if ! <cond> <statement> end`,
one can write `<cond> || <statement>` (which could be read as: `<cond>` *or else* `<statement>`).

Probably worth PRing this separately.

EC2. In this case only port 22 needs to be opened at the remote cluster coupled with SSH client
authenticated via public key infrastructure (PKI). Authentication credentials can be supplied
via `sshflags`, for example ```sshflags=`-i <keyfile>` ```.
via `sshflags`, for example * sshflags=`-i <keyfile>` *.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original Markdown is correct, though, and the updated version seems like a step back.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we need to fix on the DocumenterVitepress side, I couldn't figure out the right escaping sequence in order to get something that vitepress can render. @asinghvi17, here at the bottom is the expected code by vitepress: https://luxdl.github.io/DocumenterVitepress.jl/v0.0.18/markdown-examples#Escaping-characters

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a note, and related to #53988 (comment) as well, but having to sort out the escaping for everything etc. is a major drawback of the Markdown -> AST -> Markdown -> HTML approach DocumenterVitepress is taking. Getting away from all that was the major reason why we transitioned away from MkDocs in the first place back in the day.

@inkydragon inkydragon added the docsystem The documentation building system label Apr 9, 2024
@ViralBShah
Copy link
Member

It does look nice visually! I'm sure there's many tweaks to be made, but it does look beautiful (to me).

@LilithHafner
Copy link
Member

Lovely!

It would also be nice to bump DocumenterVitepress to at least 0.1.0, the "every release is breaking" semantic is not ideal.

@asinghvi17
Copy link
Contributor

Not really sure why we have the package.json and .vitepress directory here? The build should be seamless (i.e. that you don't configure anything outside of the makedocs call). It should also not require any external dependencies to be configured (i.e. Node, which I think this currently needs?).

It is! The installation of Node here is purely so we can cache node_modules for efficiency. The .vitepress folder is also there for theme customization - without it, you get something like https://chairmarks.lilithhafner.com/dev/ (you can even have a hero page, but to style it you need .vitepress/theme/style.css). We could have this point to an external file through a field in the MarkdownVitepress struct.

@LilithHafner
Copy link
Member

I have a package.json file in that repo even though I don't do (or at least don't intend to do) any customization. Happy to accept a PR that deletes that file (provided the docs still build)

@fingolfin
Copy link
Member

It looks nice at first glance, but I dislike how the information density is sooo much lower. E.g. comparing https://lazarusa.github.io/JuliaDocs/manual/documentation and https://docs.julialang.org/en/v1.12-dev/manual/documentation/ on my MacBook 15" I see maybe 60% of the actual content. All this extra padding and empty lines, etc. adds up, as does the low max-width that seems to be fashionable these days (removing it makes it a little bit better but still far behind the old).

@fingolfin
Copy link
Member

Another thing is the low contrast, e.g. dark gray on light gray navigation menu :-(. Perhaps there are other "themes" available that avoid this pitfall?

@ToucheSir
Copy link

ToucheSir commented Apr 11, 2024

My first test was to search for mean. Not only was https://docs.julialang.org/en/v1/stdlib/Statistics/#Statistics.mean not near the top of the results like in the current docs search, it didn't show up at all! For all my gripes with the current docs site, this VitePress demo seems like a major usability regression.

@asinghvi17
Copy link
Contributor

That is a good point @ToucheSir. It's been working better than the regular search for some searches, but I hadn't seen this before. I am assuming that Documenter.jl is able to customize its search index here, which we haven't done with DocumenterVitepress. @mortenpi may be able to elaborate more on this.

Vitepress also provides a bunch of search customization options which we can try to monkey around with in https://vitepress.dev/reference/default-theme-search.

@darsnack
Copy link

I do think DocumenterVitepress version seems prettier, but I share the concerns about readability at the cost of visual appeal. Here's a comparison between the current PR, the PR without a limit on max-width, and the current Documenter docs.

Screenshot 2024-04-13 at 10 34 51 AM Screenshot 2024-04-13 at 10 32 56 AM Screenshot 2024-04-13 at 10 33 09 AM

While increasing the max-width is something I support, I think it really makes it so that paragraphs are easier to read. We lose a lot of information content because of the sidebar being duplicated as the navigation bar (as well as an additional "on this page" dropdown).

I do like the navigation bar. It makes it easier to jump to a different documentation section. My suggestion would be to replace the sidebar with "on this page". Something like the right sidebar on docs.fast.ai which doesn't draw significant visual attention.

Overall though, I think the ability for DocumenterVitepress to support custom containers (e.g. before/after style code blocks) makes it much easier to write pedagogically good docs. So in support of this effort broadly.

Zentrik and others added 29 commits July 12, 2024 11:58
Currently using the fastmath vararg +, *, min, max methods only actually
sets fastmath if they are specifically overloaded even when the correct
2 argument methods have been defined.
As such, `ComplexF32, ComplexF64` do not currently set fastmath when
using the vararg methods. This will also fix any other types, such as
those in SIMD.jl, which don't overload the vararg methods.

E.g. 
```julia
x = ComplexF64(1)
f(x) = @fastmath x + x + x
```
now works correctly.

I see no reason why the vararg methods shouldn't default to using the
fastmath 2 argument methods instead of the non fastmath ones, which is
the current behaviour.

I also switched the implementation to use `afoldl` as that's what the
non fastmath vararg methods use.

Fixes JuliaLang#54456 and eschnett/SIMD.jl#108.
This prevents values with `:` in their name to be printed as labels.

### Before


![image](https://github.com/JuliaLang/julia/assets/9824244/2c2eb23f-5f0e-4cb9-aa70-41211c7bc00a)

### After


![image](https://github.com/JuliaLang/julia/assets/9824244/23dd4c5d-13c8-4952-9831-7a028f1f20d7)

---------

Co-authored-by: kimikage <kimikage.ceo@gmail.com>
Noting that the profile counters aren't atomic seems useful so I threw
that in as well.
This adds a brief summary of the different output functions (`display`,
`show`, `print`, `repr`, etc.) and how they interact to the custom
pretty-printing section of the manual, following [this post on
discourse](https://discourse.julialang.org/t/how-to-display-a-sparse-array-on-the-repl/113565/5),
since people often get confused by this.

---------

Co-authored-by: Max Horn <max@quendi.de>
Updating the jl_rng_split comment after a bit more consideration of the
comparison with SplitMix.
Co-authored-by: Lilith Orion Hafner <lilithhafner@gmail.com>
This should be a more reliable look-up, since this will directly report
the path of the currently-executing libjulia.dll.

Without this PR, `LoadLibraryW` depends on the system library search
order. When the top-level executable is adjacent to `libjulia.dll` (as
it is for our binary distribution usually), then that search should be
OK.

However, applications that use Julia as a library can end up searching
the system PATH before making it to the correct `lib/julia` directory,
causing us to load the wrong version of `libjulia.dll`. In many cases,
that extra load is benign due to the stricter separation of
libraries/symbols on Windows - However, in general it's likely to be the
cause of subtle bugs.
…Lang#54616)

there were random cases of two and even three spaces between sentences

Co-authored-by: KristofferC <kristoffer.carlsson@juliacomputing.com>
I noticed a runtime dispatch occurring in a broadcast, because the array
element is specified but not the dimensions, even though the dimensions
are known. With this PR, that runtime dispatch is eliminated by
explicitly passing the dimensions into the type.
---------

Co-authored-by: Sukera <11753998+Seelengrab@users.noreply.github.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com>
…Lang#54634)

This avoids a: `error: non-private labels cannot appear between
.cfi_startproc / .cfi_endproc pairs` error.
That error was introduced in https://reviews.llvm.org/D155245#4657075
see also llvm/llvm-project#72802
This commit makes it possible for `names` to return `using`-ed names as
well:
```julia
julia> using Base: @assume_effects

julia> Symbol("@assume_effects") in names(@__MODULE__; usings=true)
true
```

Currently, to find all names available in a module `A`, the following
steps are needed:
1. Use `names(A; all=true, imported=true)` to get the names defined by
`A` and the names explicitly `import`ed by `A`.
2. Use `jl_module_usings(A)` to get the list of modules `A` has
`using`-ed and then use `names()` to get the names `export`ed by those
modules.

This method is implemented in e.g. REPL completions, but it has a
problem: it could not get the names explicitly `using`-ed by `using B:
...` (JuliaLang#36529, JuliaLang#40356, JuliaDebug/Infiltrator.jl#106, etc.).

This commit adds a new keyword argument `usings::Bool=false` to
`names(A; ...)`, which, when `usings=true` is specified, returns all
names introduced by `using` in `A`.
In other words, `usings=true` not only returns explicitly `using`-ed
names but also incorporates step 2 above into the implementation of
`names`.

By using this new option, we can now use
`names(A; all=true, imported=true, usings=true)` to know all names
available in `A`, without implementing the two-fold steps on application
side.
As example application, this new feature will be used to simplify and
enhance the implementation of REPL completions.

- fixes JuliaLang#36529

Co-authored-by: Nathan Daly <NHDaly@gmail.com>
Co-authored-by: Sebastian Pfitzner <pfitzseb@gmail.com>
…uliaLang#54610)

The new feature `usings=true` added to `names` enhances REPL completions
by allowing explicitly `using`-ed names to be found.
```julia
julia> using Base: @assume_effects

julia> @assu| # completes to `@assume_effects`
```

As a result, the implementation of REPL completions has been simplified.
Additionally, it allows completion for names that are implicitly or
explicitly `using`-ed in code specifying a module explicitly, such as:
```julia
julia> module A end

julia> A.signi| # completes to `A.significand`
```

- fixes JuliaLang#29275
- fixes JuliaLang#40356
- fixes JuliaLang#49109
- fixes JuliaLang#53524
…ang#54635)

We may use aggressive constprop in `trevc!` to eliminate branches, which
makes the return type of `eigvec(::UpperTriangular)` concretely
inferred.
```julia
julia> @inferred eigvecs(UpperTriangular([1 0; 0 1]))
2×2 Matrix{Float32}:
 1.0  -0.0
 0.0   1.0
```
@giordano
Copy link
Member

The Git history is messed and it now contains hundreds of unrelated commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsystem The documentation building system

Projects

None yet

Development

Successfully merging this pull request may close these issues.