PDFBox网站的内容保存在Git存储库中,该存储库也镜像到GitHub。该网站分为两部分:静态内容和PDFBox API的Javadoc。这两个部分都是独立构建的,如下所述。
如果您想增强网站内容,可以提交补丁。为此,请在我们的问题跟踪器中打开一个工单,用于 并将您的补丁添加到工单中。Documentation
Component
用于生成网站的工具:
在编辑站点之前,您需要从 Git 存储库中签出它:
git clone https://gitbox.apache.org/repos/asf/pdfbox-docs
要构建网站,请转到项目根目录并运行:
$ npm install # needed only once, or if dependencies change
$ npm run build # to perform the build
更改内容时,可以在预览模式下完成网站生成。这将启动一个小的网络服务器,并在有更改时更新浏览器窗口,以便立即反映这些更改。
$ npm install # needed only once, or if dependencies change
$ npm run preview # to start the preview mode
要验证生成的网站文档,请转到项目根目录并运行:
$ npm run checks
为了重用文档中示例项目中的代码,可以使用短代码。codesnippet
简码需要两个变量
interactive/form/CreateCheckBox.java
trunk
2.0
此外 - 为了能够只将部分代码放入 文档 可以将以下注释添加到 Java 代码中
//DOC-START
...
//DOC-END
DOC-START/DOC-END 对可以多次放入 Java 中 法典。这些特殊注释行之间的所有内容都将添加 其他内容将被省略。这将允许跳过许可证 标头、导入语句等,以专注于重要位。
完成本地更改后,请按照以下步骤发布内容:
在 ~/.m2/settings.xml 文件中添加以下服务器配置
<server>
<id>pdfbox-site</id>
<username>** USERNAME **</username>
<password>** PASSWORD **</password>
</server>
pdfbox-site
引用自 PDFBox pom.xml 文件。
密码应按照Maven密码加密进行加密
确保新网站内容可以在本地构建
npm run build
这将读取源并在目录中生成新内容。./staging
当您对新内容感到满意时,请更新源存储库
git commit -m "..."
git push origin master
将新内容上传到生产站点
mvn scm-publish:publish-scm
这会将当前内容签出到目录中,应用更改并发布
对 PDFBox 生产网站的更改。./target
./staging
The Javadoc for PDFBox is hosted on javadoc.io which uses the built at release time as a source. javadoc.io also makes older versions of the Javadoc available.pdfbox-<version>-javadoc.jar
In order to update the documentation to match a latest release of a branch
release
<version>.11tydata.js
_layouts\documentation.html
The project provides a simple way to build the website sources locally using the build tool Maven.
The Maven build automatically downloads the tool binaries such as and for you. You do not need to install
those tools on your host then. The binaries are added to the local project sources only and generate the website content.node
npm
As the Maven build uses pinned versions of and that are tested to build the website you most likely avoid
build errors due to incompatible versions of tooling installed on your machine.node
npm
node.js
Make sure that you have Maven installed.
$ mvn --version
If this command fails with an error, you do not have Maven installed.
Please install Maven using your favorite package manager (like Homebrew) or from official Maven binaries
When building everything from scratch the build executes following steps:
Node.js
npm
npm
You can do all of this with one single command:
$ mvn package
The whole process takes up to five minutes (time to grab some coffee!)
When the build is finished you should see the generated website in the directory.public
When rebuilding the website the process uses some cached content.
If you want to start from scratch for some reason you can simply add the operation to the build which removes
all generated sources in the project first.clean
$ mvn clean package