diff --git a/LICENSE.md b/LICENSE.md index 0a07d02c0..68f75b894 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ -The JuDoc.jl package is licensed under the MIT "Expat" License: +The Franklin.jl package is licensed under the MIT "Expat" License: -> Copyright (c) 2018-2019: Thibaut Lienart. +> Copyright (c) 2018-2020: Thibaut Lienart. > > Permission is hereby granted, free of charge, to any person obtaining a copy > of this software and associated documentation files (the "Software"), to deal diff --git a/NEWS.md b/NEWS.md deleted file mode 100644 index 2ef99fd7c..000000000 --- a/NEWS.md +++ /dev/null @@ -1,59 +0,0 @@ -# NEWS - -## v0.3 - -Thanks a lot to [@cserteGT3](https://github.com/cserteGT3) for his input and [@cormullion](https://github.com/cormullion) for great feedback on the markdown parser through extensive testing. - -**Features** - -* indented code blocks are now supported (issue #207, PR #217) -* reference links and images like `[link][id]` with later `[id]: url` are now supported (issue #201, PR #214) -* headers are now links which facilitates internal hyper-references -* automatic table of contents via `\toc` or `\tableofcontents` (PR #188) -* added `\\` as a way to force the introduction of a line break, this can be useful in the context of inclusions etc (see https://github.com/cserteGT3/JuDocPlottest/issues/1 for context) -* html entities are now supported (issue #206, PR #209) -* double backticks are now supported for inline code (see issue #204 and PR #210) -* added `\textinput` command to display code output as formatted text (PR #194) -* added `\tableinput` command to insert and format a table corresponding to a csv file (PR #197, creds to @cserteGT3) - -**Bug fixes & improvements** - -* showing error message when an eval'd block fails (PR #187) -* issues with backslashes in code environment etc (issue #205, PR #209) -* improved status messages for `cleanpull` (PR #190) and adding the possibility to specify a commit message for `publish` (PR #191, creds to @cserteGT3) - -**Templates** (JuDocTemplates is now `0.2.5`) - -* update of KaTeX and Highlight.js respectively to `0.11` and `9.15.10` -* fixing the default rights of files to `644` - -**Other** - -* general cleanup of the code (trying to make naming more consistent and less clunky, general cleaning up etc) - -## v0.2 - -Thanks a lot to [@Invarianz](https://github.com/Invarianz), [@cserteGT3](https://github.com/cserteGT3) and [@mbaz](https://github.com/mbaz) for help and feedback leading to this version. - -**Features** - -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/syntax/#Code-insertions-1) - Julia code blocks can now be evaluated on the fly and their output displayed -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/syntax/#File-insertions-1) - Additional convenience commands for insertions (`\file`, `\figalt`, `\fig`, `\output`, `\textoutput`) -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/syntax/#More-on-paths-1) - More consistent use of relative paths for inserting assets and keeping folders organised -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/syntax/#Hyper-references-1) - `\label` allows to define anchor points for convenient hyper-references, also header sections are now anchor points themselves -* [docs](https://tlienart.github.io/JuDoc.jl/dev/#External-dependencies-1) - Users can now specify the paths to the python, pip and node executables via `ENV` if they prefer to do that -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/workflow/#Hosting-the-website-as-a-project-website-1) - Allow a site to be hosted as a project website (where the root is `/project/` instead of just `/`) - -**Bug fixes** - -* better error message if starting the server from the wrong dir ([#155](https://github.com/tlienart/JuDoc.jl/issues/155)) -* numerous fixes for windows (read-only files, paths errors, installation instructions, ...) ([#179](https://github.com/tlienart/JuDoc.jl/issues/179), [#177](https://github.com/tlienart/JuDoc.jl/issues/177), [#174](https://github.com/tlienart/JuDoc.jl/issues/174), [#167](https://github.com/tlienart/JuDoc.jl/issues/167), [#16](https://github.com/tlienart/JuDoc.jl/issues/16)0) -* fix an issue when mixing code, italic/bold (whitespace issue) ([#163](https://github.com/tlienart/JuDoc.jl/issues/163)) -* (_in 1.3_) fix an issue with parsing of nested code blocks within an escape block and paths issues ([#151](https://github.com/tlienart/JuDoc.jl/issues/151), [#15](https://github.com/tlienart/JuDoc.jl/issues/15)0) -* (_in 1.2_) fix a problem with the use of `@async` which caused hyper references to fail -* (_in 1.1_) fix toml issues and bumped KaTeX up to 0.10.2 - -**Templates** - -* [docs](https://tlienart.github.io/JuDoc.jl/dev/man/themes/#Adapting-a-theme-to-JuDoc-1) - how to adapt a theme to JuDoc / add a new template -* [demo](https://tlienart.github.io/JuDocTemplates.jl/) - a few new template: `template=sandbox`, an ultra bare bone site to just play with the JuDoc syntax and try things out; `template=hyde`, `template=lanyon`, well-known templates adapted from Jekyll. diff --git a/Project.toml b/Project.toml index 09cfcaf09..18561124d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,5 +1,5 @@ name = "Franklin" -uuid = "a9909bc6-eca0-4cc7-9395-0cac4f0fab28" +uuid = "713c75ef-9fc9-4b05-94a9-213340da978e" authors = ["Thibaut Lienart "] version = "0.4.4" diff --git a/src/JuDoc.jl b/src/Franklin.jl similarity index 99% rename from src/JuDoc.jl rename to src/Franklin.jl index 44bb8f980..1c847972b 100644 --- a/src/JuDoc.jl +++ b/src/Franklin.jl @@ -1,4 +1,4 @@ -module JuDoc +module Franklin using JuDocTemplates diff --git a/src/manager/extras.jl b/src/manager/extras.jl index 54299acc0..cfe4741cd 100644 --- a/src/manager/extras.jl +++ b/src/manager/extras.jl @@ -1,6 +1,6 @@ function lunr() prepath = get(GLOBAL_PAGE_VARS, "prepath", ""=>0).first - isempty(JuDoc.PATHS) && (FOLDER_PATH[] = pwd(); set_paths!()) + isempty(Franklin.PATHS) && (FOLDER_PATH[] = pwd(); set_paths!()) bkdir = pwd() lunr = joinpath(PATHS[:libs], "lunr") # is there a lunr folder in /libs/ diff --git a/src/manager/post_processing.jl b/src/manager/post_processing.jl index dc7e304b3..924b2412f 100644 --- a/src/manager/post_processing.jl +++ b/src/manager/post_processing.jl @@ -151,7 +151,7 @@ function optimize(; prerender::Bool=true, minify::Bool=true, sig::Bool=false, mmsg = rpad("→ Minifying *.[html|css] files...", 35) print(mmsg) # copy the script to the current dir - cp(joinpath(dirname(pathof(JuDoc)), "scripts", "minify.py"), JD_PY_MIN_NAME; force=true) + cp(joinpath(dirname(pathof(Franklin)), "scripts", "minify.py"), JD_PY_MIN_NAME; force=true) # run it succ = success(`$([e for e in split(PY)]) $JD_PY_MIN_NAME`) # remove the script file diff --git a/src/misc_utils.jl b/src/misc_utils.jl index 245143220..d6b1948d1 100644 --- a/src/misc_utils.jl +++ b/src/misc_utils.jl @@ -24,11 +24,11 @@ is a substring. Do not confuse with `String(s::SubString)` which casts `s` into # Example ```julia-repl -julia> a = SubString("hello JuDoc", 3:8); -julia> JuDoc.str(a) -"hello JuDoc" +julia> a = SubString("hello Fraknlin", 3:8); +julia> Franklin.str(a) +"hello Franklin" julia> String(a) -"llo Ju" +"llo Fr" ``` """ str(s::String)::String = s @@ -45,7 +45,7 @@ Convenience functions to take a substring of a string. # Example ```julia-repl -julia> JuDoc.subs("hello", 2:4) +julia> Franklin.subs("hello", 2:4) "ell" ``` """ @@ -61,7 +61,7 @@ Given a substring `ss`, returns the position in the parent string where the subs # Example ```julia-repl -julia> ss = SubString("hello", 2:4); JuDoc.from(ss) +julia> ss = SubString("hello", 2:4); Franklin.from(ss) 2 ``` """ @@ -75,7 +75,7 @@ Given a substring `ss`, returns the position in the parent string where the subs # Example ```julia-repl -julia> ss = SubString("hello", 2:4); JuDoc.to(ss) +julia> ss = SubString("hello", 2:4); Franklin.to(ss) 4 ``` """ @@ -89,7 +89,7 @@ Returns the string span of a regex match. Assumes there is no unicode in the mat # Example ```julia-repl -julia> JuDoc.matchrange(match(r"ell", "hello")) +julia> Franklin.matchrange(match(r"ell", "hello")) 2:4 ``` """ diff --git a/test/global/postprocess.jl b/test/global/postprocess.jl index 8640adc38..ceb6ca733 100644 --- a/test/global/postprocess.jl +++ b/test/global/postprocess.jl @@ -11,7 +11,7 @@ ) ) # --------------- - if JuDoc.JD_CAN_MINIFY + if Franklin.JD_CAN_MINIFY presize1 = stat(joinpath("css", "basic.css")).size presize2 = stat("index.html").size optimize(prerender=false) @@ -20,7 +20,7 @@ end # --------------- # verify all links - JuDoc.verify_links() + Franklin.verify_links() # --------------- # change the prepath diff --git a/test/jd_paths_vars.jl b/test/jd_paths_vars.jl index 741050014..b1241f329 100644 --- a/test/jd_paths_vars.jl +++ b/test/jd_paths_vars.jl @@ -31,7 +31,7 @@ end # copying _libs/katex in the J.PATHS[:libs] so that it can be used in testing # the js_prerender_math -cp(joinpath(dirname(dirname(pathof(JuDoc))), "test", "_libs", "katex"), joinpath(J.PATHS[:libs], "katex")) +cp(joinpath(dirname(dirname(pathof(Franklin))), "test", "_libs", "katex"), joinpath(J.PATHS[:libs], "katex")) @testset "Set vars" begin d = J.PageVars( diff --git a/test/manager/utils.jl b/test/manager/utils.jl index e85490581..670f94e90 100644 --- a/test/manager/utils.jl +++ b/test/manager/utils.jl @@ -1,31 +1,31 @@ -temp_config = joinpath(JuDoc.PATHS[:src], "config.md") +temp_config = joinpath(Franklin.PATHS[:src], "config.md") write(temp_config, "@def author = \"Stefan Zweig\"\n") -temp_index = joinpath(JuDoc.PATHS[:src], "index.md") +temp_index = joinpath(Franklin.PATHS[:src], "index.md") write(temp_index, "blah blah") -temp_index2 = joinpath(JuDoc.PATHS[:src], "index.html") +temp_index2 = joinpath(Franklin.PATHS[:src], "index.html") write(temp_index2, "blah blih") -temp_blah = joinpath(JuDoc.PATHS[:src_pages], "blah.md") +temp_blah = joinpath(Franklin.PATHS[:src_pages], "blah.md") write(temp_blah, "blah blah") -temp_html = joinpath(JuDoc.PATHS[:src_pages], "temp.html") +temp_html = joinpath(Franklin.PATHS[:src_pages], "temp.html") write(temp_html, "some html") -temp_rnd = joinpath(JuDoc.PATHS[:src_pages], "temp.rnd") +temp_rnd = joinpath(Franklin.PATHS[:src_pages], "temp.rnd") write(temp_rnd, "some random") -temp_css = joinpath(JuDoc.PATHS[:src_css], "temp.css") +temp_css = joinpath(Franklin.PATHS[:src_css], "temp.css") write(temp_css, "some css") -JuDoc.process_config() +Franklin.process_config() @testset "Prep outdir" begin - JuDoc.prepare_output_dir() - @test isdir(JuDoc.PATHS[:pub]) - @test isdir(JuDoc.PATHS[:css]) - temp_out = joinpath(JuDoc.PATHS[:pub], "tmp.html") + Franklin.prepare_output_dir() + @test isdir(Franklin.PATHS[:pub]) + @test isdir(Franklin.PATHS[:css]) + temp_out = joinpath(Franklin.PATHS[:pub], "tmp.html") write(temp_out, "This is a test page.\n") # clear is false => file should remain - JuDoc.prepare_output_dir(false) + Franklin.prepare_output_dir(false) @test isfile(temp_out) # clear is true => file should go - JuDoc.prepare_output_dir(true) + Franklin.prepare_output_dir(true) @test !isfile(temp_out) end @@ -38,37 +38,37 @@ end infra_files = empty(md_files) literate_files = empty(md_files) watched_files = [md_files, html_files, other_files, infra_files, literate_files] - JuDoc.scan_input_dir!(md_files, html_files, other_files, infra_files, literate_files, true) - @test haskey(md_files, JuDoc.PATHS[:src_pages]=>"blah.md") - @test md_files[JuDoc.PATHS[:src_pages]=>"blah.md"] == mtime(temp_blah) == stat(temp_blah).mtime - @test html_files[JuDoc.PATHS[:src_pages]=>"temp.html"] == mtime(temp_html) - @test other_files[JuDoc.PATHS[:src_pages]=>"temp.rnd"] == mtime(temp_rnd) + Franklin.scan_input_dir!(md_files, html_files, other_files, infra_files, literate_files, true) + @test haskey(md_files, Franklin.PATHS[:src_pages]=>"blah.md") + @test md_files[Franklin.PATHS[:src_pages]=>"blah.md"] == mtime(temp_blah) == stat(temp_blah).mtime + @test html_files[Franklin.PATHS[:src_pages]=>"temp.html"] == mtime(temp_html) + @test other_files[Franklin.PATHS[:src_pages]=>"temp.rnd"] == mtime(temp_rnd) end @testset "Config+write" begin - JuDoc.process_config() - @test JuDoc.GLOBAL_PAGE_VARS["author"].first == "Stefan Zweig" + Franklin.process_config() + @test Franklin.GLOBAL_PAGE_VARS["author"].first == "Stefan Zweig" rm(temp_config) - @test_logs (:warn, "I didn't find a config file. Ignoring.") JuDoc.process_config() + @test_logs (:warn, "I didn't find a config file. Ignoring.") Franklin.process_config() # testing write head = "head" pg_foot = "\npage_foot" foot = "foot {{if hasmath}} {{fill author}}{{end}}" - JuDoc.write_page(JuDoc.PATHS[:src], "index.md", head, pg_foot, foot) - out_file = joinpath(JuDoc.out_path(JuDoc.PATHS[:folder]), "index.html") + Franklin.write_page(Franklin.PATHS[:src], "index.md", head, pg_foot, foot) + out_file = joinpath(Franklin.out_path(Franklin.PATHS[:folder]), "index.html") @test isfile(out_file) @test read(out_file, String) == "head\n
\n

blah blah

\n\n\npage_foot\n
\nfoot Stefan Zweig" end -temp_config = joinpath(JuDoc.PATHS[:src], "config.md") +temp_config = joinpath(Franklin.PATHS[:src], "config.md") write(temp_config, "@def author = \"Stefan Zweig\"\n") rm(temp_index2) @testset "Part convert" begin # ✅ 16 aug 2018 - write(joinpath(JuDoc.PATHS[:src_html], "head.html"), raw""" + write(joinpath(Franklin.PATHS[:src_html], "head.html"), raw""" @@ -76,13 +76,13 @@ rm(temp_index2) """) - write(joinpath(JuDoc.PATHS[:src_html], "page_foot.html"), raw""" + write(joinpath(Franklin.PATHS[:src_html], "page_foot.html"), raw"""
""") - write(joinpath(JuDoc.PATHS[:src_html], "foot.html"), raw""" + write(joinpath(Franklin.PATHS[:src_html], "foot.html"), raw""" """) @@ -92,14 +92,14 @@ rm(temp_index2) J.jd_fullpass(watched_files; clear=clear) - @test issubset(["css", "libs", "index.html"], readdir(JuDoc.PATHS[:folder])) - @test issubset(["temp.html", "temp.rnd"], readdir(JuDoc.PATHS[:pub])) - @test all(split(read(joinpath(JuDoc.PATHS[:folder], "index.html"), String)) .== split("\n\n\t\n\t\t\n\t\t\n\t\n\n
\n

blah blah

\n\n
\n\t\t
\n\t\t\t\t© All rights reserved.\n\t\t
\n
\n
\n \n")) + @test issubset(["css", "libs", "index.html"], readdir(Franklin.PATHS[:folder])) + @test issubset(["temp.html", "temp.rnd"], readdir(Franklin.PATHS[:pub])) + @test all(split(read(joinpath(Franklin.PATHS[:folder], "index.html"), String)) .== split("\n\n\t\n\t\t\n\t\t\n\t\n\n
\n

blah blah

\n\n
\n\t\t
\n\t\t\t\t© All rights reserved.\n\t\t
\n
\n
\n \n")) end @testset "Err procfile" begin write(temp_index, "blah blah { blih etc") println("🐝 Testing error message...:") - @test_throws J.OCBlockError JuDoc.process_file_err(:md, JuDoc.PATHS[:src] => "index.md"; clear=false) + @test_throws J.OCBlockError Franklin.process_file_err(:md, Franklin.PATHS[:src] => "index.md"; clear=false) end diff --git a/test/runtests.jl b/test/runtests.jl index f9df86b65..1bd29e6d3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ -using JuDoc, Test, Markdown, Dates, Random, Literate -const J = JuDoc +using Franklin, Test, Markdown, Dates, Random, Literate +const J = Franklin const R = @__DIR__ -const D = joinpath(dirname(dirname(pathof(JuDoc))), "test", "_dummies") +const D = joinpath(dirname(dirname(pathof(Franklin))), "test", "_dummies") # NOTE this first file MUST be included before running the rest of the tests # otherwise you may get an error like "key 0x099191234..." was not found or @@ -73,13 +73,13 @@ begin # clean up rm(p; recursive=true, force=true) end -cd(dirname(dirname(pathof(JuDoc)))) +cd(dirname(dirname(pathof(Franklin)))) println("INTEGRATION") include("integration/literate.jl") flush_td() -cd(joinpath(dirname(dirname(pathof(JuDoc))))) +cd(joinpath(dirname(dirname(pathof(Franklin))))) println("COVERAGE") include("coverage/extras1.jl")