开放个人docworks maven architype到github

fujohnwang

2011-03-25


author: fujohnwang

docbook maven build archetype project with docbkx maven plugin

Location: https://github.com/fujohnwang/docworks

This is my personal docbook project which helps me write a lot of blogs and articles. I had an Ant-based alike project before which helped me complete my first book - “UnveilSpring”(Spring揭秘 In Chinese), but it just works. After I moved to Maven, I found the docbkx maven plugin, so it finally helped me build this archetype project.

To start to use it, you need to know some common locations:

1- src/main/docbook

you put your docbook writings under this directory, sub-directories are allowed. In practice, you should create its own sub-directory for your articles, the reason is with each of your article, it not only contains words but also pictures and other media materials. So usually, before starting to write a new article, you create a sub-folder under src/main/docbook and at least create an “images” sub-folder to hold the images of your article, the real docbook writing will be dropped under this sub-folder directly.

Sounds tedious, don’t worry, I create some easy things to help you on this:

mvn -Pcreate

or

mvn -PcreateX -Dmodule=the path you want to create for your article

The former command will create a “tmpdir” under src/main/docbook, and copy article template and necessary images(addons and callout icons) to it, you can rename it after the command run. Of course, if you want to customize the name of the folder to be created, you can run the latter command. OK, that’s for src/main/docbook folder.

2- src/main/resources

I have collected necessary resources and put them under this folder, most of the time, you don’t need to worry about these things.

3- src/main/assembly

If you wan’t to distributed your articles, you can customize assembly descriptor under this folder, of course, using the default is ok. Since you have know everything necessary, and you may have put some docbook articles under the src/main/docbook folder, run “mvn package”, after that, you can get your generated document under “target/docs/html” folder, What? Build Error? Find out the reason yourself by focusing on your docbook document structure and elements ;-)

GL & HF


>>>>>> 更多阅读 <<<<<<

「为AI疯狂」星球上,扶墙老师正在和朋友们讨论有趣的AI话题,你要不要⼀起来呀?^-^
这里

  1. 不但有及时新鲜的AI资讯和深度探讨
  2. 还分享AI工具、产品方法和商业机会
  3. 更有体系化精品付费内容等着你,加入星球(https://t.zsxq.com/0dI3ZA0sL) 即可免费领取。(加入之后一定记得看置顶消息呀!)

知识星球二维码

存量的时代,省钱就是赚钱。
在增量的时代,省钱其实是亏钱。
避坑儿是省钱的一种形式,更是真正聪明人的选择!
弯路虽然也是路,但还是能少走就少走,背后都是高昂的试错成本。
订阅「福报」,少踩坑,少走弯路,多走一步,就是不一样的胜率!

订阅「福报Premium订阅」