简体   繁体   English

将CVS / SVN转换为编程摘录站点

[英]Convert CVS/SVN to a Programming Snippets Site

I use cvs to maintain all my python snippets, notes, c, c++ code. 我使用cvs维护我的所有python代码段,注释,c,c ++代码。 As the hosting provider provides a public web- server also, I was thinking that I should convert the cvs automatically to a programming snippets website. 由于托管服务提供商还提供了公共Web服务器,因此我认为我应该将cvs自动转换为编程摘要网站。

  1. cvsweb is not what I mean. cvsweb不是我的意思。
  2. doxygen is for a complete project and to browse the self-referencing codes online.I think doxygen is more like web based ctags. doxygen是一个完整的项目,可以在线浏览自引用代码。我认为doxygen更像是基于Web的ctags。

I tried with rest2web , it is requires that I write /restweb headers and files to be .txt files and it will interfere with the programming language syntax. 我尝试过rest2web ,它要求我将/ restweb标头和文件编写为.txt文件,这会干扰编程语言的语法。

An approach I have thought is: 1) run source-hightlight and create .html pages for all the scripts. 我认为一种方法是:1)运行source-hightlight并为所有脚本创建.html页面。 2) now write a script to index those script .htmls and create webpage. 2)现在编写一个脚本来索引这些脚本.htmls并创建网页。 3) Create the website of those pages. 3)创建这些页面的网站。

before proceeding, I thought I shall discuss here, if the members have any suggestion. 在继续之前,我想如果成员有任何建议,我将在这里进行讨论。 What do do, when you want to maintain your snippets and notes in cvs and also auto generate it into a good website. 当您想在cvs中维护代码片段和注释并自动将其生成到良好的网站时,该怎么办。 I like rest2web for converting notes to html. 我喜欢rest2web将注释转换为html。

Run Trac on the server linked to the (svn) repository. 在链接到(svn)存储库的服务器上运行Trac The Trac wiki can conveniently refer to files and changesets. Trac Wiki可以方便地引用文件和变更集。 You get TODO tickets, too. 您也可以获得TODO门票。

enscript or pygmentize (part of pygments) can be used to convert code to HTML. enscript或pygmentize(部分pygments)可用于将代码转换为HTML。 You can use a custom header or footer to link to the actual code for download. 您可以使用自定义的页眉或页脚链接到实际代码以进行下载。

I finally settled for rest2web . 我终于解决了rest2web I had to do the following. 我必须执行以下操作。

  1. Use a separate python script to recursively copy the files in the CVS to a separate directory. 使用单独的python脚本以递归方式将CVS中的文件复制到单独的目录中。
  2. Added extra files index.txt and template.txt to all the directories which I wanted to be in the webpage. 向我想要在网页中的所有目录中添加了额外的文件index.txt和template.txt。
  3. The best thing about rest2web is that it supports python scripting within the template.txt, so I just ran a loop of the contents and indexed them in the page. rest2web 最好的地方是它在template.txt中支持python脚本,因此我只运行了内容的循环并在页面中对其进行了索引。
  4. There is still lot more to go to automate the entire process. 要自动化整个过程还有很多事情要做。 For eg. 例如。 Inline viewing of programs and colorization, which I think can be done with some more trials. 内联查看程序和着色,我认为可以通过更多尝试来完成。

I have the completed website here, It is called uthcode . 我在这里有完整的网站,称为uthcode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM