Quanta RefreshDoc/da: Difference between revisions

From KDE UserBase Wiki
(Importing a new version from external source)
No edit summary
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
<languages />
== Dette er en vejledning i, hvordan man holder qualta-php-documentation opdateret. ==
== Dette er en vejledning i, hvordan man holder quanta-php-documentation opdateret. ==


Følg denne guide skridt for skridt.
Følg denne guide skridt for skridt.


=== Første skridt: Installér php-documentation ===
=== Første skridt: Installér php-documentation ===
Først skal du installere pakken php-documentation for din distribution.
Først skal du installere php-documentationspakken for din distribution.


I Ubuntu skriver du:
I Ubuntu skriver du:
Line 11: Line 11:




=== Second: Download newest php-documentation ===
=== Andet skridt: Download den nyeste php-documentation ===


{{Note|1= If you do as proposed, the doc-files will have user-rights. In this case that is not important.}}
{{Note/da|1= Hvis du gør som foreslået, så får doc-filerne brugerrettigheder. I dette tilfælde er det ikke vigtigt.}}


* Visit http://www.php.net/download-docs.php and download the "Many HTML files "-archive for your prefered language.
*Gå til http://www.php.net/download-docs.php og download arkivet "Many HTML files " for dit foretrukne sprog.
* Extract that package into your home-directory, so you have a directory /home/user/html
* Pak arkivet ud i din hjemmemappe, sådan at du har en mappe /home/user/html
* Copy these files into the doc-dir. (in Ubuntu: /usr/share/doc/php-doc/html)<br />
* Kopiér disse filer til dokumentationsmappen (i Ubuntu: /usr/share/doc/php-doc/html)<br />
{{Input|1= # rm -fr /usr/share/doc/php-doc/html
{{Input|1= # rm -fr /usr/share/doc/php-doc/html
# mv /home/user/html /usr/share/doc/php-doc/html}}<br />
# mv /home/user/html /usr/share/doc/php-doc/html}}<br />
* Execute
* Kør
{{Input|1= # chmod -R o+rwx /usr/share/doc/php-doc/html}}
{{Input|1= # chmod -R o+rwx /usr/share/doc/php-doc/html}}




=== Third: refresh docrc-file, so that Quanta has a new index ===
=== Tredje skridt: genopfrisk filen docrc, sådan at Quanta har et nyt indeks ===


Install '''php-cli'''
Installér '''php-cli'''


In Ubuntu, type:
I Ubuntu skriver du:
{{Input|1=sudo apt-get install php-cli}}
{{Input|1=sudo apt-get install php-cli}}


Copy the code from [[Quanta_RefreshDoc_script|this page]] and save it into the quanta-doc dir as /usr/share/apps/quanta/doc/gendoc.php
Kopiér koden fra [[Special:myLanguage/Quanta_RefreshDoc_script|denne side]] og gem den i mappen quanta-doc som /usr/share/apps/quanta/doc/gendoc.php


The script uses the '''php-XML-Reader'''. Because of that you have to make some html-files XML-valid:
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:
* Open /usr/share/apps/quanta/doc/php/index.html and /usr/share/apps/quanta/doc/php/funcref.html
* Åbn /usr/share/apps/quanta/doc/php/index.html og /usr/share/apps/quanta/doc/php/funcref.html
* Change the line
* Ret linjen
{{Output|1=<meta http-equiv="content-type" content="text/html; charset=UTF-8">}}
{{Input|1=<meta http-equiv="content-type" content=<nowiki>"text/html; charset=UTF-8"</nowiki>>}}
into
til
{{Input|1=<meta http-equiv="content-type" content="text/html; charset=UTF-8" />}}
{{Input|1=<meta http-equiv="content-type" content=<nowiki>"text/html; charset=UTF-8"</nowiki> />}}
* cd into /usr/share/apps/quanta/doc/
* cd til /usr/share/apps/quanta/doc/
* Execute (as root)
* Kør (som root)
{{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''' er den fil, som indeholder php-dolumentationens normale indeks.


'''php-fref.docrc''' is an additional index file for all pages, functions are listed in it. I thought it could be convenient.
'''php-fref.docrc''' er et yderligere indeks for alle sider, hvor funktioner indføres. Jeg tænkte, at det kunne være nyttigt.




=== Fourth: Optional: Get better look-and-feel for the pages ===
=== Fjerde skridt: Få siderne til at se bedre ud ===


It's possible to use a css-file on the documentation. Install and open '''KFileReplace'''.
Det er muligt at bruge en css-fil på dokumentationen. Installér op åbn '''KFileReplace'''.


* Click ''Customize Search/Replace Session''
* Klik <menuchoice>Tilpas søg-/erstat-session</menuchoice>
* Change ''Location'' to /usr/share/doc/php-doc/html
* Skriv /usr/share/doc/php-doc/html i feltet <menuchoice>Sted</menuchoice>
* Set ''Filter'' to    *.html
* Skriv *.html i <menuchoice>Filter</menuchoice>
* Disable including subfolders
* Fjern flueben ved <menuchoice>Inkludér undermapper</menuchoice>
* Set Encoding to utf8
* I <menuchoice>Tegnsæt for filerne</menuchoice> vælger du <menuchoice>UTF-8</menuchoice>
* Don't type anything in ''Search'' or ''Replace''
* Skriv ikke noget i felterne <menuchoice>Søg</menuchoice> og <menuchoice>Erstat</menuchoice>
* Click <menuchoice>Search Later</menuchoice>
* Klik på knappen <menuchoice>Søg senere</menuchoice>
* Click on the <menuchoice>Add string</menuchoice> Button in main window
* Klik på knappen <menuchoice>Tilføj streng</menuchoice> i hovedvinduet
* Activate ''Search and replace'' mode
* Aktivér <menuchoice>Søge- og erstatningstilstand</menuchoice>
* Search for:
* I feltet <menuchoice>Søg efter</menuchoice> skriver du:
{{Output|1= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
{{Input|1= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <nowiki>"http://www.w3.org/TR/html4/loose.dtd"</nowiki>>
  <html>
  <html>
   <head>
   <head>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"}}<br />
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"}}<br />
* Replace with:
* I feltet <menuchoice>Erstat med</menuchoice> skriver du:
{{Input|1= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
{{Input|1= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<nowiki>http://www.w3.org/TR/html4/loose.dtd"</nowiki>>
  <html>
  <html>
   <head>
   <head>
Line 75: Line 75:
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"}}
   <meta http-equiv="content-type" content="text/html; charset=UTF-8"}}


{{Warning|1=Make sure that you don't have a newline at the end!}}
{{Warning/da|1=Sørg for, at du ikke har et linjeskift til sidst!!}}
* Click on the -> arrow.
* Klik på <menuchoice>pilen -></menuchoice>.
* Click <menuchoice>OK</menuchoice>
* Klik <menuchoice>OK</menuchoice>
* Click on the <menuchoice>Replace</menuchoice> Button (not ''Simulate'') in the main window.
* Klik på knappen <menuchoice>Erstat</menuchoice> (ikke <menuchoice>Simulér</menuchoice>) i hovedvinduet.
* Create a style.css-File in /usr/share/doc/php-doc/html
* Lav en fil ved navn style.css i /usr/share/doc/php-doc/html


Here you could modify the appearance.
Her kan du modificere udseendet.


If you like the php.net-style, download it from
Hvis du kan lide php.net's stil, download den fra
  http://www.php.net/styles/site.css and modify it. Maybe you want to make the font-size smaller etc.
  http://www.php.net/styles/site.css
og modificér den. Du kan for eksempel gøre skriftstørrelsen mindre etc.


Good luck
Held og lykke


[[Category:Development]]
[[Category:Udvikling/da]]
[[Category:Tutorials]]
[[Category:Vejledning/da]]

Latest revision as of 10:18, 24 November 2010

Other languages:

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

Følg denne guide skridt for skridt.

Første skridt: Installér php-documentation

Først skal du installere php-documentationspakken 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 er den fil, som indeholder php-dolumentationens normale indeks.

php-fref.docrc er et yderligere indeks for alle sider, hvor funktioner indføres. Jeg tænkte, at det kunne være nyttigt.


Fjerde skridt: Få siderne til at se bedre ud

Det er muligt at bruge en css-fil på dokumentationen. Installér op åbn KFileReplace.

  • Klik Tilpas søg-/erstat-session
  • Skriv /usr/share/doc/php-doc/html i feltet Sted
  • Skriv *.html i Filter
  • Fjern flueben ved Inkludér undermapper
  • I Tegnsæt for filerne vælger du UTF-8
  • Skriv ikke noget i felterne Søg og Erstat
  • Klik på knappen Søg senere
  • Klik på knappen Tilføj streng i hovedvinduet
  • Aktivér Søge- og erstatningstilstand
  • I feltet Søg efter skriver du:
<!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"


  • I feltet Erstat med skriver du:
<!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"

Advarsel

Sørg for, at du ikke har et linjeskift til sidst!!


  • Klik på pilen ->.
  • Klik OK
  • Klik på knappen Erstat (ikke Simulér) i hovedvinduet.
  • Lav en fil ved navn style.css i /usr/share/doc/php-doc/html

Her kan du modificere udseendet.

Hvis du kan lide php.net's stil, så download den fra

http://www.php.net/styles/site.css

og modificér den. Du kan for eksempel gøre skriftstørrelsen mindre etc.

Held og lykke