goingmywaynet/AutoBuildSphinxIndexScript_forWindows
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
============================================================ Sphinx Index Auto Build Script for Windows Power Shell ============================================================ Author : Joey Chen / joey-tech(at)goingmyway.net Description ============================================================ Windowsの共有フォルダに対してインデックスをつける為にsphinxを利用する スクリプトです。 各フォルダに指定のファイル名 (000_IndexFile.txtなど)をアンカーファイルとして、 これにReSTで書くことでそれを収集し、sphinx で html 化します。 具体的には以下の処理を行います。 1. 指定ディレクトリ配下に対して、指定されたファイル名を再帰検索 (各ディレクトリを検索する) 2. そのファイルを .txt から UTF-8 の .rst 化し、指定の(Sphinx source) フォルダにcopy。この際、copy元フォルダへのリンクを .rst ファイルに追記。 3. Sphinx の make.bat html を実行し、HTMLをビルド 4. ビルドされた _build/html フォルダを指定の公開用ディレクトリにCopy また、Sphinx の日本語検索オプション辞書として利用可能な MeCAB のユーザ辞書 を生成するスクリプト CreateDic.wsf も付属します。 Script Usage ============================================================ sphinx と MeCAB の環境を整えた上で、 CreateDic.wsf と CreateIndex.wsf と config.js 、 Libフォルダを同一のフォルダに配置します。 config.js -------------------------------- Dif_* 、Dir_* 、 File_* の変数を定義した上で本ファイルをWindowsで実行する。 sphinxの動作パスなど、環境別の変数を定義する。 CreateIndex.wsf -------------------------------- Dif_* 、Dir_* 、 File_* の変数を定義した上で本ファイルをWindowsで実行する。 CreateDic.wsf -------------------------------- Dir_* 、 File_* の変数を定義した上で本ファイルをWindowsで実行する。 なお、windows環境での sphinx 動作環境の整備例は http://note.sicafe.net/sphinx_memo/installAtWinNoAdmin.html を参考にしてみてください。 Files ============================================================ README : このファイル CreateIndex.wsf : Sphinx の HTML ビルド スクリプト本体 CreateDic.wsf : MeCAB の ユーザ辞書更新スクリプト本体 config.js : 環境変数設定ファイル Lib/* : 上記スクリプトから参照される .js ライブラリ sample/* : このスクリプトを使った生成例です KnowledgeBase .. 検索される元データフォルダ KnowledgeBase.sphinx .. sphinx のワーキングディレクトリ KnowledgeBase.index .. 生成されたHTMLファイルの配置先 より具体的な使い方 ============================================================ Dir_indexSearchDir変数で定義したフォルダ の配下に 任意の名前のフォルダを作成し、 :: 000_IndexFile.txt というアンカーファイルを作ると、 1. そのファイルの内容を元に HTMLファイルが生成されます。 2. 各文書内には、作成したディレクトリに対するリンクが末尾に *Contents* *Folder* という名前で配置されます。 なお、この HTMLファイル は スクリプトによって自動的に アンカーファイルの内容を参照し、Sphinx <http://sphinx-users.jp/index.html> と呼ばれるドキュメント生成ツールを利用して生成されます。 フォルダとファイルの作成例 -------------------------------- 以下の様なフォルダとファイル構成を作成すると、ツールは自動的に アンカーファイルの中身を元に HTML ファイルを作成して、 その内容を HTMLファイル に追記します。 :: \\\\ServerName\\KnoledgeBaseFolder \ \-- 20120507_KnowledgeBaseの使い方 \ \-- 000_IndexFile.txt \-- メモ.pdf \-- 画面コピー.png HTMLファイルの内容は アンカーファイル のみが反映されますが、HTMLファイルの末尾に当該フォルダへのリンクが自動生成 されるので、そのリンクを通じて他の(PDFなどの)ファイルを見ることができます。 アンカーファイルの文法について -------------------------------- アンカーファイルは一般的なWindowsで扱うテキストファイル - ShiftJIS 文字コード - CRLF 改行コード で記述する必要がありますが、基本的にはWindows付属の ノートパット(Notepad) アプリで十分書くことができます。 めんどくさい場合は、既設の他のフォルダ配下にあるファイルを流用したりしたほうが早いかもしれません。 記述文法については、 reStructuredText という文法を利用しています。 詳細については `reStructuredText入門 <http://sphinx.shibu.jp/rest.html>`_ を参照してください。 さらに活用したい場合は、 `Sphinx 逆引き辞典 <http://sphinx-users.jp/reverse-dict/index.html>`_ についても参考になります。 HTMLファイルの自動生成について -------------------------------- 端末のタスクスケジューラーに登録することで定期的に動作させることができます。 生成された時間は、Knowledge Base のトップページに ( *月* / *日* *時* : *分* Build) と表示されます。 タスクスケジューラなので、この自動生成は、コンテンツの変化有無にかかわらず発生します。
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published