Quanta RefreshDoc/da: Difference between revisions

From KDE UserBase Wiki
(Importing a new version from external source)
(Importing a new version from external source)
Line 43: Line 43:
{{Input|1=php gendoc.php php}}
{{Input|1=php gendoc.php php}}


That script will update '''php.docrc''' and create '''php_fref.docrc'''.
Dette script opdaterer '''php.docrc''' og laver '''php_fref.docrc'''.


'''php.docrc''' is the file for the normal index of the php-documentation.
'''php.docrc''' is the file for the normal index of the php-documentation.

Revision as of 09:56, 13 November 2010

Other languages:

Dette er en vejledning i, hvordan man holder qualta-php-documentation opdateret.

Følg denne guide skridt for skridt.

Første skridt: Installér php-documentation

Først skal du installere pakken php-documentation for din distribution.

I Ubuntu skriver du:

sudo apt-get install php-doc


Andet skridt: Download den nyeste php-documentation

Note

Hvis du gør som foreslået, så får doc-filerne brugerrettigheder. I dette tilfælde er det ikke vigtigt.


  • Gå til http://www.php.net/download-docs.php og download arkivet "Many HTML files " for dit foretrukne sprog.
  • Pak arkivet ud i din hjemmemappe, sådan at du har en mappe /home/user/html
  • Kopiér disse filer til dokumentationsmappen (i Ubuntu: /usr/share/doc/php-doc/html)
# rm -fr /usr/share/doc/php-doc/html
 # mv /home/user/html /usr/share/doc/php-doc/html


  • Kør
# chmod -R o+rwx /usr/share/doc/php-doc/html


Tredje skridt: genopfrisk filen docrc, sådan at Quanta har et nyt indeks

Installér php-cli

I Ubuntu skriver du:

sudo apt-get install php-cli

Kopiér koden fra denne side og gem den i mappen quanta-doc som /usr/share/apps/quanta/doc/gendoc.php

Scriptet bruger php-XML-Reader. På grund af det kan du være nødt til at gøre nogle html-filer til gyldig XML:

  • Åbn /usr/share/apps/quanta/doc/php/index.html og /usr/share/apps/quanta/doc/php/funcref.html
  • Ret linjen
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

til

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  • cd til /usr/share/apps/quanta/doc/
  • Kør (som root)
php gendoc.php php

Dette script opdaterer php.docrc og laver php_fref.docrc.

php.docrc is the file for the normal index of the php-documentation.

php-fref.docrc is an additional index file for all pages, functions are listed in it. I thought it could be convenient.


Fourth: Optional: Get better look-and-feel for the pages

It's possible to use a css-file on the documentation. Install and open KFileReplace.

  • Click Customize Search/Replace Session
  • Change Location to /usr/share/doc/php-doc/html
  • Set Filter to *.html
  • Disable including subfolders
  • Set Encoding to utf8
  • Don't type anything in Search or Replace
  • Click Search Later
  • Click on the Add string Button in main window
  • Activate Search and replace mode
  • Search for:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
  <head>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"


  • Replace with:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
  <head>
   <link rel="stylesheet" type="text/css" href="style.css" />
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"

Warning

Make sure that you don't have a newline at the end!
  • Click on the -> arrow.
  • Click OK
  • Click on the Replace Button (not Simulate) in the main window.
  • Create a style.css-File in /usr/share/doc/php-doc/html

Here you could modify the appearance.

If you like the php.net-style, download it from

http://www.php.net/styles/site.css and modify it. Maybe you want to make the font-size smaller etc.

Good luck