Skip to content

README update #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ When it's time to push updates, **only** use `include("deploy.jl")` (assuming yo
### Modifying literate scripts

1. add packages if you need additional ones (`] add ...`), make sure to update explicit compat requirements in the `Project.toml` file
1. add/modify tutorials in the `scripts/` folder
1. add/modify tutorials in the `_literate/` folder
1. to help display things neatly on the webpage (no horizontal overflow), prefer `pprint` from `PrettyPrinting.jl` to display things like `NamedTuple`
1. add `;` at the end of final lines of code blocks if you want to suppress output

Expand Down Expand Up @@ -99,13 +99,13 @@ The last thing to do is to add a link to the page in `_layout/head.html` so that

```julia
cd("path/to/MLJTutorials")
using JuDoc
using Franklin
serve()
```

If you have changed the *code* of some of the literate scripts, JuDoc will need to re-evaluate some of the code which may take some time, progress is indicated in the REPL.
If you have changed the *code* of some of the literate scripts, Franklin will need to re-evaluate some of the code which may take some time, progress is indicated in the REPL.

If you decide to change some of the code while `serve()` is running, this is fine, JuDoc will detect it and trigger an update of the relevant web pages (after evaluating the new code).
If you decide to change some of the code while `serve()` is running, this is fine, Franklin will detect it and trigger an update of the relevant web pages (after evaluating the new code).

**Notes**:
- avoid modifying the literate file, killing the Julia session, then calling `serve()` that sequence can cause weird issues where Julia will complain about the age of the world...
Expand All @@ -132,13 +132,13 @@ Do not forget to add the `# hide` which will ensure the line is not displayed on

#### Stale files

It can happen that something went wrong and you'd like to force JuDoc to re-evaluate everything to clear things up. To do this, head to the parent markdown file (e.g. `my-tutorial.md`) and add below the other ones:
It can happen that something went wrong and you'd like to force Franklin to re-evaluate everything to clear things up. To do this, head to the parent markdown file (e.g. `my-tutorial.md`) and add below the other ones:

```julia
@def reeval = true
```

save the file, wait for JuDoc to complete its update and then remove it (otherwise it will reevaluate the script every single pass which can slow things down a lot).
save the file, wait for Franklin to complete its update and then remove it (otherwise it will reevaluate the script every single pass which can slow things down a lot).

If you get an "age of the world" error, the `reeval` steps above usually works as well.

Expand Down Expand Up @@ -166,7 +166,7 @@ the first command will remove all stale generated HTML which may conflict with o
*Requirements*:

* admin access to the repo
* `] add Literate JuDoc NodeJS`
* `] add Literate Franklin NodeJS`
* install `highlight.js` and `gh-pages` from within Julia: ``run(`sudo $(npm_cmd()) i highlight.js gh-pages`)``

Assuming you have all that, just run
Expand Down
6 changes: 3 additions & 3 deletions _literate/EX-horse.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ## Initial data processing
#
# In this example, we consider the [UCI "horse colic" dataset](https://archive.ics.uci.edu/ml/datasets/Horse+Colic)
# In this example, we consider the [UCI "horse colic" dataset](http://archive.ics.uci.edu/ml/datasets/Horse+Colic)
#
# This is a reasonably messy classification problem with missing values etc and so some work should be expected in the feature processing.
#
Expand All @@ -11,8 +11,8 @@
using MLJ, StatsBase
MLJ.color_off() # hide
using HTTP, CSV, DataFrames
req1 = HTTP.get("https://archive.ics.uci.edu/ml/machine-learning-databases/horse-colic/horse-colic.data")
req2 = HTTP.get("https://archive.ics.uci.edu/ml/machine-learning-databases/horse-colic/horse-colic.test")
req1 = HTTP.get("http://archive.ics.uci.edu/ml/machine-learning-databases/horse-colic/horse-colic.data")
req2 = HTTP.get("http://archive.ics.uci.edu/ml/machine-learning-databases/horse-colic/horse-colic.test")
header = ["surgery", "age", "hospital_number",
"rectal_temperature", "pulse",
"respiratory_rate", "temperature_extremities",
Expand Down
6 changes: 3 additions & 3 deletions _literate/EX-wine.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# ## Initial data processing
#
# In this example, we consider the [UCI "wine" dataset](https://archive.ics.uci.edu/ml/datasets/wine)
# In this example, we consider the [UCI "wine" dataset](http://archive.ics.uci.edu/ml/datasets/wine)
#
# > These data are the results of a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars. The analysis determined the quantities of 13 constituents found in each of the three types of wines.
#
# ### Getting the data
# Let's download the data thanks to the [HTTP.jl](HTTP.get("https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data")) package and load it into a DataFrame via the [CSV.jl](https://github.com/JuliaData/CSV.jl) package:
# Let's download the data thanks to the [HTTP.jl](HTTP.get("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data")) package and load it into a DataFrame via the [CSV.jl](https://github.com/JuliaData/CSV.jl) package:

using HTTP, CSV, MLJ, StatsBase, PyPlot
MLJ.color_off() # hide
req = HTTP.get("https://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data")
req = HTTP.get("http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data")
data = CSV.read(req.body,
header=["Class", "Alcool", "Malic acid",
"Ash", "Alcalinity of ash", "Magnesium",
Expand Down