Allow to set an alternative source directory (for editing)#625
Conversation
|
Usage in m-site-p in apache/maven-site-plugin#1239. |
doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/RenderingContextTest.java
Outdated
Show resolved
Hide resolved
43adea5 to
3a6151e
Compare
|
This is quite some change. Will take a bit to review. |
Always check if a file is existing before returning true for isEditable and non-null for getDoxiaSourcePath()/getDoxiaSourcePath(String) This closes #277
3a6151e to
b4e6c73
Compare
| assertEquals("path/file.html", docRenderingContext.getOutputPath()); | ||
| assertEquals("..", docRenderingContext.getRelativePath()); | ||
| } | ||
| } |
There was a problem hiding this comment.
This should have been a "git mv" instead of deletion and addtion, no?
There was a problem hiding this comment.
Look at https://archive.kernel.org/oldwiki/git.wiki.kernel.org/index.php/GitFaq.html#Why_does_Git_not_.22track.22_renames.3F. Wouldn't make a difference in the diff.
| * | ||
| * @param path | ||
| * @param editable | ||
| * @param path absolute path to the site directory containing doxia sources files, expected to have a Doxia Site layout, i.e. one directory per Doxia parser module |
| * | ||
| * @param path | ||
| * @param editable | ||
| * @param path absolute path to the site directory containing doxia sources files, expected to have a Doxia Site layout, i.e. one directory per Doxia parser module |
There was a problem hiding this comment.
You say absolute path, but we don't enforce it...?
| if (editableSourceDirectories.isEmpty()) { | ||
| return Collections.singleton(path); | ||
| } else { | ||
| return editableSourceDirectories; |
There was a problem hiding this comment.
This should return only a view, no?
doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SiteRenderingContext.java
Show resolved
Hide resolved
| private void addModuleFiles( | ||
| File rootDir, | ||
| File siteRootDirectory, | ||
| SiteDirectory siteDirectory, |
There was a problem hiding this comment.
If we have a site root directory, why is path the absolute for site directory?
There was a problem hiding this comment.
I don't get this question, but siteRootDirectory is pointing to the ${basedir} while siteDirectory is usually ${basedir}/src/site.
| /** The project's build directory, may be {@code null} rendered from a Doxia source) */ | ||
| private final File rootDirectory; | ||
|
|
||
| /** The site's root directory (never null), must be within below {@link #rootDirectory}, may be {@code null} rendered from a Doxia source */ |
There was a problem hiding this comment.
Contradiction. It first says never null, then it maybe null
There was a problem hiding this comment.
Right, may in fact be null. Fixed in 1efd3e8.
...ite-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderingContext.java
Show resolved
Hide resolved
|
|
||
| /** | ||
| * Get the relative path to site root. | ||
| * Get the relative path of the parent folder to site root. |
1efd3e8 to
66067af
Compare
|
@kwin Please assign appropriate label to PR according to the type of change. |
Always check if a file is existing before returning true for isEditable and non-null for getDoxiaSourcePath()/getDoxiaSourcePath(String)
This closes #277
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.