Closed jbampton closed 3 weeks ago
So I think the docs need some love.
I wonder when I change these links (just some examples)
[Sedona version release notes](../../setup/release-notes/)
[how to contribute](../rule)
<img src="../../image/ide-java-1.png"/>
[ST_S2CellIds](../Function/#st_s2cellids)
to
[Sedona version release notes](../setup/release-notes.md)
[how to contribute](rule.md)
<img src="../image/ide-java-1.png"/>
[ST_S2CellIds](Function.md#st_s2cellids)
Then the links will work locally in my editor and on my local mkdocs server. But will these kind of changes break the website?
When I change/fix all links this would affect like 25 files.
I was looking at the official guide on links here:
https://www.mkdocs.org/user-guide/writing-your-docs/#linking-to-pages
On quick review I was not able to find much on links in the Material docs
https://squidfunk.github.io/mkdocs-material/setup/
But you can setup the website locally and build and serve it to test the links.
There is the guide on the website here:
https://sedona.apache.org/latest/setup/compile/#compile-the-documentation
Ok, I think I got it. I issued the following pull request: https://github.com/apache/sedona/pull/1334.
Output is now as follows:
INFO - [macros] - Macros arguments: {'module_name': 'main', 'modules': [], 'render_by_default': True, 'include_dir': '', 'include_yaml': [], 'j2_block_start_string': '', 'j2_block_end_string': '', 'j2_variable_start_string': '', 'j2_variable_end_string': '', 'on_undefined': 'keep', 'on_error_fail': False, 'verbose': False}
INFO - [macros] - Extra variables (config file): ['version', 'social', 'sedona', 'sedona_create_release']
INFO - [macros] - Extra filters (module): ['pretty']
INFO - Cleaning site directory
INFO - Building documentation to directory: C:\Projects\sedona\site
INFO - The following pages exist in the docs directory, but are not included in the "nav" configuration:
- api\python-api.md
- tutorial\python-vector-osm.md
WARNING - A relative path to 'api/rdocs' is included in the 'nav' configuration, which is not found in the documentation files.
WARNING - A relative path to 'api/rdocs' is included in the 'nav' configuration, which is not found in the documentation files.
WARNING - A relative path to 'api/rdocs' is included in the 'nav' configuration, which is not found in the documentation files.
INFO - Doc file 'api/java-api.md' contains an unrecognized relative link '../javadoc/spark/', it was left as is.
WARNING - Doc file 'api/sql/Overview.md' contains a relative link '../../scaladoc/spark/org/apache/sedona/sql/utils/index.html', but the target 'scaladoc/spark/org/apache/sedona/sql/utils/index.html' is not found among documentation files.
INFO - Doc file 'api/viz/java-api.md' contains an unrecognized relative link '../../javadoc/spark/', it was left as is.
WARNING - Doc file 'tutorial/sql.md' contains a relative link '../api/scaladoc/spark/org/apache/sedona/sql/utils/index.html', but the target 'api/scaladoc/spark/org/apache/sedona/sql/utils/index.html' is not found among documentation files.
WARNING - Doc file 'tutorial/sql.md' contains a relative link '../api/javadoc/sql/org/apache/sedona/sql/utils/index.html', but the target 'api/javadoc/sql/org/apache/sedona/sql/utils/index.html' is not found among documentation files.
WARNING - Doc file 'tutorial/sql.md' contains a relative link '../api/javadoc/sql/org/apache/sedona/sql/utils/index.html', but the target 'api/javadoc/sql/org/apache/sedona/sql/utils/index.html' is not found among documentation files.
WARNING - Doc file 'tutorial/sql.md' contains a relative link '../api/javadoc/sql/org/apache/sedona/sql/utils/index.html', but the target 'api/javadoc/sql/org/apache/sedona/sql/utils/index.html' is not found among documentation files.
INFO - Documentation built in 6.81 seconds
To explain a bit futher. A lot of these constructs were like:
<img width="250" src="../../image/st_snap/st-snap-applied.png" title="ST_Snap applied example"/>
I replaced them with
![ST_Snap applied example](../../image/st_snap/st-snap-applied.png "ST_Snap applied example"){: width="250px"}
so the relative paths are now correct, alt and title properties being applied and size is set correctly.
Following occurrences:
Use [ST_S2CellIds](../Function/#st_s2cellids) to generate cell ID
I replaced them with
Use [ST_S2CellIds](Function.md#st_s2cellids)
adding the .md suffix and removing the leading forward slash which I think is not necessary. Also the slash just before the # anchor can be removed.
I hope this works out beautifully for all editors/ide's I currently use Jetbrains IDE.
We have an issue with the changes mentioned here:
https://github.com/apache/sedona/pull/1334#discussion_r1569108112
I issued a pull request, could you have a look? https://github.com/apache/sedona/pull/1359
Thanks @mebrein :+1:
Looks like most of the links have been cleaned up.
A lot less messages in the console now when running mkdocs build
or mkdocs serve
Expected behavior
Links should be cleaned up and most of the
INFO
messages about links should be removed.And the links should also work on the GitHub website when viewing the Markdown docs.
Actual behavior
When running locally:
mkdocs serve
we have a lot of extra
INFO
messages that mention our links can be cleaned up.If you browse the docs directly on GitHub some of these links are broken.
You can run
mkdocs serve 2> mkdocs-serve-output.txt
to pipe the error messages to a file.Example output below
Steps to reproduce the problem
Run:
mkdocs serve
and watch the output in the consoleSettings
Sedona version = master
Apache Spark version = ?
Apache Flink version = ?
API type = Scala, Java, Python?
Scala version = 2.11, 2.12, 2.13?
JRE version = 1.8, 1.11?
Python version = Python 3.11.6
Environment = Standalone, AWS EC2, EMR, Azure, Databricks?