From Fedora Project Wiki

No edit summary
(Fix some markup)
Line 2: Line 2:


==Preparation==
==Preparation==
0.1 Create a local copy of the git repository of the docs.fedoraproject.org website:
<!-- Use <ol> and <li> so we can embed <pre> inside -->
 
<ol><li>Create a local copy of the git repository of the docs.fedoraproject.org website:
:'''git clone ssh://''USERNAME''@git.fedorahosted.org/git/docs/web.git'''
<pre>git clone ssh://USERNAME@git.fedorahosted.org/git/docs/web.git</pre>
 
Where '''''USERNAME''''' is your FAS username.
Where '''''USERNAME''''' is your FAS username
{{admon/note | Large download | This download will take some time, even on fast connections.}}</li>
 
<li>Download the ''publican-1.99'' and ''publican-website-1.99'' packages from http://rlandmann.fedorapeople.org/publican and save them to your system.</li>
0.2 Download the ''publican-1.99'' and ''publican-website-1.99'' packages from http://rlandmann.fedorapeople.org/publican and save them to your system.
<li>Install the ''publican-1.99'' and ''publican-website-1.99'' packages. In the directory where you saved the packages in step 0.2, become root and run:
 
<pre>yum localinstall publican-1.99* publican-website-1.99* --nogpgcheck</pre>
0.3 Install the ''publican-1.99'' and ''publican-website-1.99'' packages. In the directory where you saved the packages in step 0.2, become root and run:
</li></ol>
 
:'''yum localinstall publican-1.99* publican-website-1.99* --nogpgcheck'''


==Publishing a new document==
==Publishing a new document==
Line 19: Line 17:
These instructions apply to documents that have not been published in this version in this language before, even if the same document was published for an earlier version of Fedora or has already been published for the current version of Fedora in other languages.
These instructions apply to documents that have not been published in this version in this language before, even if the same document was published for an earlier version of Fedora or has already been published for the current version of Fedora in other languages.


0. Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
<ol><li>Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
 
<pre>git pull</pre></li>
:'''git pull'''
 
1. Change to the directory where you keep a checked-out copy of the document that you want to publish, then run:


:'''publican build --embedtoc --publish --formats epub,html,html-single,pdf --langs ''LANGUAGE_CODES'''''
<li>Change to the directory where you keep a checked-out copy of the document that you want to publish, then run:
<pre>publican build --embedtoc --publish --formats epub,html,html-single,pdf --langs LANGUAGE_CODES</pre>
where '''''LANGUAGE_CODES''''' is a comma-separated list of the languages in which you want to publish this document. </li>


where '''''LANGUAGE_CODES''''' is a comma-separated list of the languages in which you want to publish this document.
<li>Browse to the '''publish''' subdirectory and to the documents themselves inside it to ensure that the documents have built as you expected. In particular, verify:
 
2. Browse to the '''publish''' subdirectory and to the documents themselves inside it to ensure that the documents have built as you expected. In particular, verify:
* the product name is '''Fedora''' (note capitalization)
* the product name is '''Fedora''' (note capitalization)
* the version number is correct
* the version number is correct
* the document title is properly capitalized and spaced: for example, '''Foo Guide''', not '''foo-guide'''
* the document title is properly capitalized and spaced: for example, '''Foo Guide''', not '''foo-guide'''</li>
 
3. Install the book to the Fedora website:
 
:'''publican install_book --site_config ''PATH_TO_SITE_CONFIG_FILE'' --lang ''LANGUAGE_CODE'''''


where '''''PATH_TO_SITE_CONFIG_FILE''''' is the path to the '''homepage.cfg''' file in your local copy of the docs.fedoraproject.org website, and '''''LANGUAGE_CODE''''' is the language in which you are publishing the document. Note that you can only run '''publican&nbsp;install_book''' for one language at a time.
<li>Install the book to the Fedora website:
<pre>publican install_book --site_config PATH_TO_SITE_CONFIG_FILE --lang LANGUAGE_CODE</pre>
where '''''PATH_TO_SITE_CONFIG_FILE''''' is the path to the '''homepage.cfg''' file in your local copy of the docs.fedoraproject.org website, and '''''LANGUAGE_CODE''''' is the language in which you are publishing the document. Note that you can only run '''publican&nbsp;install_book''' for one language at a time.</li>


4. Change to the directory in which you keep your local copy of the site and run:
<li>Change to the directory in which you keep your local copy of the site and run:
: '''git add .'''
<pre>git add .
: '''git commit -m"''DESCRIPTION_OF_YOUR_CHANGES''"'''
git commit -m "DESCRIPTION_OF_YOUR_CHANGES"
: '''git push'''
git push</pre></li></ol>


==Removing a document==
==Removing a document==
To remove a document for a particular version of Fedora in a particular language:
To remove a document for a particular version of Fedora in a particular language:


0. Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
<ol><li>Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
 
<pre>git pull</pre></li>
:'''git pull'''
 
1. Change to the directory where you keep a checked-out copy of the document that you want to remove, then run:


:'''publican remove_book --site_config ''PATH_TO_SITE_CONFIG_FILE'' --lang ''LANGUAGE_CODE'''''
<li>Change to the directory where you keep a checked-out copy of the document that you want to remove, then run:
<pre>publican remove_book --site_config PATH_TO_SITE_CONFIG_FILE --lang LANGUAGE_CODE</pre>


where '''''PATH_TO_SITE_CONFIG_FILE''''' is the path to the '''homepage.cfg''' file in your local copy of the docs.fedoraproject.org website, and '''''LANGUAGE_CODE''''' is the language in which you are removing the document. Note that you can only run '''publican&nbsp;remove_book''' for one language at a time.
where '''''PATH_TO_SITE_CONFIG_FILE''''' is the path to the '''homepage.cfg''' file in your local copy of the docs.fedoraproject.org website, and '''''LANGUAGE_CODE''''' is the language in which you are removing the document. Note that you can only run '''publican&nbsp;remove_book''' for one language at a time.</li>


2. Change to the directory in which you keep your local copy of the site and run:
<li>Change to the directory in which you keep your local copy of the site and run:
: '''git add .'''
<pre>git add .
: '''git commit -m"''DESCRIPTION_OF_YOUR_CHANGES''"'''
git commit -m "DESCRIPTION_OF_YOUR_CHANGES"
: '''git push'''
git push</pre></li></ol>


==Updating a document==
==Updating a document==
To update a document previously published in a particular language for a particular version of Fedora, change into the directory in which you keep a checked-out copy of the document, then follow the steps to remove the old document, followed by the steps to add a new document. In brief, you will run:
To update a document previously published in a particular language for a particular version of Fedora, change into the directory in which you keep a checked-out copy of the document, then follow the steps to remove the old document, followed by the steps to add a new document. In brief, you will run:
: '''publican remove_book'''
publican remove_book
: '''publican build'''
publican build
: '''publican install_book'''
publican install_book




[[Category:Docs Project]]
[[Category:Docs Project]]

Revision as of 18:38, 24 May 2010

The forthcoming Publican 2.0 includes features to automate publishing documents to websites. As of May 2010, Publican 2.0 is still under development, but RPMs for a beta version, Publican 1.99, are available.

Preparation

  1. Create a local copy of the git repository of the docs.fedoraproject.org website:
    git clone ssh://USERNAME@git.fedorahosted.org/git/docs/web.git

    Where USERNAME is your FAS username.

    Note.png
    Large download
    This download will take some time, even on fast connections.
  2. Download the publican-1.99 and publican-website-1.99 packages from http://rlandmann.fedorapeople.org/publican and save them to your system.
  3. Install the publican-1.99 and publican-website-1.99 packages. In the directory where you saved the packages in step 0.2, become root and run:
    yum localinstall publican-1.99* publican-website-1.99* --nogpgcheck

Publishing a new document

Warning.png
Publican now controls the directory structure and the SQLite database that manages the site and its tables of contents. Do not add or remove directories from the directory tree manually as we did in the past.

These instructions apply to documents that have not been published in this version in this language before, even if the same document was published for an earlier version of Fedora or has already been published for the current version of Fedora in other languages.

  1. Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
    git pull
  2. Change to the directory where you keep a checked-out copy of the document that you want to publish, then run:
    publican build --embedtoc --publish --formats epub,html,html-single,pdf --langs LANGUAGE_CODES
    where LANGUAGE_CODES is a comma-separated list of the languages in which you want to publish this document.
  3. Browse to the publish subdirectory and to the documents themselves inside it to ensure that the documents have built as you expected. In particular, verify:
    • the product name is Fedora (note capitalization)
    • the version number is correct
    • the document title is properly capitalized and spaced: for example, Foo Guide, not foo-guide
  4. Install the book to the Fedora website:
    publican install_book --site_config PATH_TO_SITE_CONFIG_FILE --lang LANGUAGE_CODE
    where PATH_TO_SITE_CONFIG_FILE is the path to the homepage.cfg file in your local copy of the docs.fedoraproject.org website, and LANGUAGE_CODE is the language in which you are publishing the document. Note that you can only run publican install_book for one language at a time.
  5. Change to the directory in which you keep your local copy of the site and run:
    git add .
    git commit -m "DESCRIPTION_OF_YOUR_CHANGES"
    git push

Removing a document

To remove a document for a particular version of Fedora in a particular language:

  1. Update your copy of the docs.fedoraproject.org website. In the directory where you keep your local copy of the site, run:
    git pull
  2. Change to the directory where you keep a checked-out copy of the document that you want to remove, then run:
    publican remove_book --site_config PATH_TO_SITE_CONFIG_FILE --lang LANGUAGE_CODE
    where PATH_TO_SITE_CONFIG_FILE is the path to the homepage.cfg file in your local copy of the docs.fedoraproject.org website, and LANGUAGE_CODE is the language in which you are removing the document. Note that you can only run publican remove_book for one language at a time.
  3. Change to the directory in which you keep your local copy of the site and run:
    git add .
    git commit -m "DESCRIPTION_OF_YOUR_CHANGES"
    git push

Updating a document

To update a document previously published in a particular language for a particular version of Fedora, change into the directory in which you keep a checked-out copy of the document, then follow the steps to remove the old document, followed by the steps to add a new document. In brief, you will run:

publican remove_book
publican build
publican install_book