Change \n to <br> in auto generated parameter documentation - #385
Change \n to <br> in auto generated parameter documentation#385MaceKuailv wants to merge 9 commits into
\n to <br> in auto generated parameter documentation#385Conversation
|
This PR should only affect documentation, the failed tests look similar to the other failed test in other PRs. |
|
Thank you for this thats really helpful. It seems like its now not rendering the new lines at all, maybe the br needs to be escaped some way? https://oceanbiome.github.io/OceanBioME.jl/previews/PR385/generated/CarbonChemistry_parameters/ |
| value_width = maximum((length("$value") for value in values)) | ||
| # sanitize a value so it stays inside a single markdown table row | ||
| clean(v) = let s = "$v" | ||
| s = replace(s, r"\r?\n\s*" => "<br>") # newlines -> HTML break (drop indent) |
There was a problem hiding this comment.
Maybe this still needs to be \n but the "|" escaping is what atually needed fixing?
There was a problem hiding this comment.
I do think that removing \n is needed. As you can see from the screen shot,

The Is = ....that is after an \n is in the second line.
Perhaps we just need to change <br> to something else that the documentation can recognize. Sorry, I should have tested this on my side with the documentation. Unfortunately, I still have some difficulties with generating the documentation on my side, and won’t have time to work on this for a couple of days. If you know what this error is, it would be quite helpful.
ERROR: LoadError: `makedocs` encountered an error [:example_block] -- terminating build before rendering.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:44
[2] runner(::Type{Documenter.Builder.RenderDocument}, doc::Documenter.Document)
@ Documenter ~/.julia/packages/Documenter/AXNMp/src/builder_pipeline.jl:259
[3] dispatch(::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Document)
@ Documenter.Selectors ~/.julia/packages/Documenter/AXNMp/src/utilities/Selectors.jl:170
[4] #95
@ ~/.julia/packages/Documenter/AXNMp/src/makedocs.jl:283 [inlined]
[5] withenv(::Documenter.var"#95#96"{Documenter.Document}, ::Pair{String, Nothing}, ::Vararg{Pair{String, Nothing}})
@ Base ./env.jl:265
[6] #93
@ ~/.julia/packages/Documenter/AXNMp/src/makedocs.jl:282 [inlined]
[7] cd(f::Documenter.var"#93#94"{Documenter.Document}, dir::String)
@ Base.Filesystem ./file.jl:112
[8] makedocs(; debug::Bool, format::Documenter.HTMLWriter.HTML, kwargs::@Kwargs{sitename::String, authors::String, pages::Vector{Pair{String, Any}}, modules::Vector{Module}, plugins::Vector{CitationBibliography}, doctest::Bool, clean::Bool, checkdocs::Symbol})
@ Documenter ~/.julia/packages/Documenter/AXNMp/src/makedocs.jl:281
[9] top-level scope
@ ~/Documents/pkg_dvlp/OceanBioME.jl/docs/make.jl:137
[10] include(mod::Module, _path::String)
@ Base ./Base.jl:306
[11] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:317
[12] _start()
@ Base ./client.jl:550
in expression starting at /Users/kuailv/Documents/pkg_dvlp/OceanBioME.jl/docs/make.jl:137
If not, I will circle back to this in a couple of days.
|
@jagoosw I am happy to report back that the link looks OK now. I have also added a short script to run the examples manually, and I have added an instruction for other contributors. I hope that is useful. I have removed two duplicate entries of bibliography. Otherwise, the CI process will fail. It was not failing after my first commit, so must be a recent update. I see that you are wrestling with the CI process, this will also help you resolve a very small part of it. Good luck with the rest! 🍀 |
I was clicking around in the documentation and rediscovered issue #239, see also https://oceanbiome.github.io/OceanBioME.jl/stable/generated/CarbonChemistry_parameters/. I realized that it is about the different types of returns "\r\n" and there is a very simple fix. The resulting markdown file looks OK to me:
CarbonChemistry default parameters
ionic_strengthIs = 19.924 S/(1000.0 + -1.005 S)
solubilityln(k₀/k°) = -60.2409 + 9345.17 / T + 23.3585 (log(T) - log(100)) + 0.0 T² + (0.023517 + -0.00023656 T + 4.7036e-7 T²)S
carbonic_acidlog₁₀(k₁/k°) = 61.2172 + -3633.86 / T + -9.6777 log(T) + 0.011555 S + -0.0001152 S², K2 = Second carbon dioxide dissociation constant
log₁₀(k₂/k°) = -25.929 + -471.78 / T + 3.16967 log(T) + 0.01781 S + -0.0001122 S²)
boric_acidln(kᵇ/k°) = 148.0248 + (-8966.9 + -2890.53 √S + -77.942 S + 1.728 √S³ + -0.0996 S²) / T
+ 137.1942 * √S
+ 1.62142 * S
+ (-24.4344 + -25.085 √S + -0.2474 S ) * log(T)
+ 0.053105 * √S * T
waterln(kʷ/k°) = 148.9652
+ -13847.26 / T
+ -23.6521 log(T)
+ (-5.977 + 118.67 / T + 1.0495 log(T)) √S
+ -0.01615 * S
sulfateln(kˢ/k°) = 141.328
+ -4276.1 / T
+ -23.093 log(T)
+ (324.57 + -13856.0 / T + -47.986 log(T)) √Is
+ (-771.54 + 35474.0 / T + 114.723 log(T)) Is
+ -2698.0 √Is³ / T
+ 1776.0 Is² / T
+ log(1 + -0.001005 S)
fluorideln(kᶠ/k°) = -9.68
+ 874.0 / T
+ 0.111 √S
+ log(1 + 0.0 S)
+ log(1 + 0.0 S / Kˢ)
phosphoric_acidln(kᵖⁿ/k°) = 115.525
+ -4576.752 / T
+ -18.453 log(T)
+ (0.69171 + -106.736 / T) √S
+ (-0.01844 + -0.65643 / T) S, KP2 = Phosphate dissociation constant
ln(kᵖⁿ/k°) = 172.0883
+ -8814.715 / T
+ -27.927 log(T)
+ (1.3566 + -160.34 / T) √S
+ (-0.05778 + 0.37335 / T) S, KP3 = Phosphate dissociation constant
ln(kᵖⁿ/k°) = -18.141
+ -3070.75 / T
+ 0.0 log(T)
+ (2.81197 + 17.27039 / T) √S
+ (-0.09984 + -44.99486 / T) S)
silicic_acidln(kˢⁱ/k°) = 117.385
+ -8904.2 / T
+ -19.334 log(T)
+ (3.5913 + -458.79 / T) √Is
+ (-1.5998 + 188.74 / T) Is
+ (0.07871 + -12.1652 / T) Is²
+ log(1 + -0.001005 S)
calcite_solubilitylog₁₀(kₛₚ) = -171.9065 + -0.077993 T + 2839.319 / T + 71.595 log(T)
log₁₀(kₛₚˢ) = log₁₀(kₛₚ) + (-0.77712 + 0.0028426 T + 178.34 / T) √S
+ -0.07711 S + 0.0041249 √S³
density_functionfirst_virial_coefficientcross_virial_coefficientsolverAlthough I am still having a little bit difficulty with running
docs/make.jlto create the documentation, I am relatively confident that this should solve the issue.