You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: websites/site/contributing/documentation.md
+49-28Lines changed: 49 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,11 +54,9 @@ The file/folder structure is within `/websites/site`:
54
54
55
55
### Deploy the website
56
56
57
-
- The website is deployed via git
58
-
- Checkout the Git repo that hosts the documentation: https://github.com/apache/lucenenet-site/tree/asf-site_(ensure you have `asf-site` branch checked out, not `master`)_
59
-
- Copy the build output of the website to the root. The build output will be all of the files in the `/websites/site/_site` in your main Lucene.NET checked out Git repository.
60
-
- Commit and push these changes
61
-
- The new version of the website will be live. If the amount of new files committed is large, the new files may take some time to become live.
57
+
- The website is deployed via GitHub and is hosted by static files here: https://github.com/apache/lucenenet-site/tree/asf-site_(ensure you have `asf-site` branch checked out, not `master`)_
58
+
- Any file changes made in the `master` branch of the Lucene.Net repository under the path `/websites/site/*` will trigger a GitHub action to build the site and publish a Pull Request to the https://github.com/apache/lucenenet-site repository where it can be accepted
59
+
- Review and merge the Pull Request. The new version of the website will be live. If the amount of new files committed is large, the new files may take some time to become live.
62
60
63
61
## API Docs
64
62
@@ -95,39 +93,62 @@ The script parameters are:
95
93
96
94
The file/folder structure is within `/websites/apidocs`:
97
95
98
-
-`docs.ps1` - the build script
99
-
-`docfx.json` - the DocFx configuration file _(see docfx manual for further info)_
100
-
-`lucenetemplate/*` - the custom template files to style the website
101
-
-`*.md` - the root site content such as the index and download pages
102
-
-`toc.yml` - these files determine the menu structures _(see docfx manual for further info)_
103
-
-`tools/*` - during the build process some tools will be downloaded which are stored here
104
-
-`_site` - this is the exported static site that is generated
105
-
106
-
> [!NOTE]
107
-
> The project is going through a trial run of using mini-sites instead of a single API docs site. Currently, the active DocFx configuration files are the `docfx.<project>.json` files, however both the mini-site and `docfx.json` configuration files need to be updated, since there is a chance we will need to switch back.
96
+
-`docs.ps1` - The build script
97
+
-`docfx.*.json` - The DocFx configuration files _(see docfx manual for further info)_
98
+
-`docfx.{library}.json` - Where {library} is an individual Lucene.NET project (i.e. `codecs`). Each library is built as it's own individual DocFx site and it's xref maps are exported to file to be shared between DocFx builds.
99
+
-`docfx.global.json` - Each library DocFx json references this file for global metadata. This is where all global metadata such as Title, Logo, Footer, etc... are declared.
100
+
-`docfx.global.subsite.json` - Each library DocFx json references this file for global metadata which denotes the [`_rel`](https://dotnet.github.io/docfx/tutorial/intro_template.html#system-generated-properties) (The relative path of the root output folder from current output file. i.e. the base URL). For example: `https://lucenenet.apache.org/docs/4.8.0-beta00009/`.
101
+
-`docfx.site.json` - Once each library is built and it's xref maps are exported, the main documentation site container is built with this definition.
102
+
-`lucenetemplate/*` - The custom template files to style the website
103
+
-`*.md` - The root site content such as the index and download pages
104
+
-`toc.yml` - These files determine the menu structures _(see docfx manual for further info)_
105
+
-`tools/*` - During the build process some tools will be downloaded which are stored here
106
+
-`_site` - This is the exported static site that is generated
108
107
109
-
### Process overview
108
+
### Java to Markdown converter
110
109
111
110
The documentation generation is a complex process because it needs to convert the Java Lucene project's documentation into a usable format to produce the output Lucene.NET's documentation.
112
111
113
-
The process overview is:
112
+
The `JavaDocToMarkdownConverter` dotnet tool to is used to convert the Java Lucene project's docs into a useable format for DocFx. This tool uses a release tag output of the Java Lucene project as it's source to convert against the Lucene.NET's source. This tool must **only** be executed against the current documentation branch, for example in 4.8.0 it is: `docs/markdown-converted/4.8.1`. This conversion process does not need to be executed everytime the docs are built, it is executed rarely when:
113
+
- A new major or minor version of Lucene.Net is created and the conversion needs to be re-executed again the Java Lucene source. In this case a new documentation branch should be created from the previous documentation branch.
114
+
- Updates to the `JavaDocToMarkdownConverter` are made and the conversion needs to be re-executed.
115
+
116
+
#### Manual execution
117
+
118
+
To use the dotnet tool you must download the current tag of the Java Lucene project, for example: ["4.8.1"](https://github.com/apache/lucene-solr/releases/tag/releases%2Flucene-solr%2F4.8.1)
Where `<LUCENE DIRECTORY>` is the `lucene` sub folder location of the Java Lucene tag downloaded above. The `<LUCENENET DIRECTORY>` is the folder of your locally checked out Lucene.Net git repository of the documentation tag (i.e. `docs/markdown-converted/4.8.1`).
132
+
133
+
#### Automated execution
134
+
135
+
A powershell script has been created to automate the above. Execute the `./src/docs/convert.ps1` script and enter the current Lucene version to convert from. For example, for Lucene.Net 4.8.0 we are converting from the Java Lucene build release of ["4.8.1"](https://github.com/apache/lucene-solr/releases/tag/releases%2Flucene-solr%2F4.8.1) so in this case enter: 4.8.1 at the prompt or call the whole script like `./src/docs/convert.ps1 -JavaLuceneVersion 4.8.1`
136
+
137
+
#### Review, commit and merge
138
+
139
+
Once the conversion is done, review, commit and push those changes. Many times there will just be whitespace changes in the files especially if this process has been executed before for the same source/destination version. If this is a new source/destination version there will be a **lot** of file changes, at least one file per folder. If there are formatting issues or irregularities in the converted output then these will need to be addressed by making changes to the conversion tool itself (generally only needed for new major version releases).
140
+
141
+
Once pushed, you can merge those changes to the `master` branch. Doing this may trigger merge conflicts because the documentation files may have been manually edited. In these cases you will need to manually review and fix the merge conflicts with your favorite merge tool ensuring that the most recent manual changes done are kept.
114
142
115
-
- Use the `JavaDocToMarkdownConverter` project within the `DocumentationTools.sln` solution to run the conversion of the Java Lucene projects docs into a useable format for DocFx. This tool takes uses a release tag output of the Java Lucene project as it's source to convert against the Lucene.NET's source.
116
-
- Run the documentation build script to produce the documentation site
117
-
- Publish the output to the [`lucenenet-site`](https://github.com/apache/lucenenet-site) repository into a corresponding named version directory
143
+
#### Tool info
118
144
119
-
We don't want to manually change the converted resulting markdown files (`.md`) because they would get overwritten again when the conversion process is re-executed. Therefore to fix any formatting issues or customized output of the project docs, these customizations/fixes/tweaks are built directly into the conversion process itself in the `JavaDocToMarkdownConverter.csproj` project.
145
+
-[Source code is here](https://github.com/NightOwl888/lucenenet-javadoc2markdown)
- Checkout the Lucene.Net release tag to build the docs against
124
-
- Execute the `./src/docs/convert.ps1` script and enter the current Lucene version to convert from.
125
-
- For example, for Lucene.Net 4.8.0 we are converting from the Java Lucene build release of ["4.8.1"](https://github.com/apache/lucene-solr/releases/tag/releases%2Flucene-solr%2F4.8.1) so in this case enter: 4.8.1 at the prompt or call the whole script like `./src/docs/convert.ps1 -JavaLuceneVersion 4.8.1`
126
-
- This script will download and extract the Java Lucene release files, build the `DocumentationTools.sln` solution and execute the `JavaDocToMarkdownConverter.exe`
127
-
- Review and commit the files changed
128
-
- Many times there will just be whitespace changes in the files especially if this process has been executed before for the same source/destination version.
129
-
- If this is a new source/destination version there will be a **lot** of file changes, at least one file per folder.
130
-
- If there are formatting issues or irregularities in the converted output then these will need to be addressed by making changes to the conversion tool itself `JavaDocToMarkdownConverter.csproj` (generally only needed for new major version releases)
131
152
- Execute the `./websites/apidocs/docs.ps1` script to build and serve the api docs website locally for testing.
0 commit comments