Quanta RefreshDoc/uk: Difference between revisions

From KDE UserBase Wiki
(Created page with "Цей скрипт виконає оновлення '''php.docrc''' і створить '''php_fref.docrc'''.")
(Created page with "'''php.docrc''' — файл звичайного покажчика документації до PHP.")
Line 45: Line 45:
Цей скрипт виконає оновлення '''php.docrc''' і створить '''php_fref.docrc'''.
Цей скрипт виконає оновлення '''php.docrc''' і створить '''php_fref.docrc'''.


'''php.docrc''' is the file for the normal index of the php-documentation.
'''php.docrc''' — файл звичайного покажчика документації до PHP.


'''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''' is an additional index file for all pages, functions are listed in it. I thought it could be convenient.

Revision as of 13:20, 10 October 2010

Other languages:

У цьому підручнику наведено настанови щодо підтримання актуальності даних quanta-php-documentation

Будь ласка, виконуйте ці покрокові настанови.

Перше: встановіть пакунок php-documentation

По-перше, вам слід встановити пакунок php-documentation вашого дистрибутива.

В системі Ubuntu віддайте команду:

sudo apt-get install php-doc


Друге: оновіть документацію до PHP

Зауваження

Якщо ви виконаєте запропоновані настанови, доступ до файлів doc матимуть звичайні користувачі. У нашому випадку це не важливо.


  • Відкрийте сторінку http://www.php.net/download-docs.php і звантажте архів у форматі "Many HTML files " мовою, яку ви знаєте.
  • Виконайте видобування цього пакунка до вашого домашнього каталогу так, щоб у вас був каталог /home/користувач/html
  • Скопіюйте видобуті файли до каталогу документації. (в 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


  • Віддайте команду
# chmod -R o+rwx /usr/share/doc/php-doc/html


Третє: оновіть файл docrc, щоб у Quanta ви мали справу з новим покажчиком

Встановіть php-cli

В Ubuntu віддайте команду:

sudo apt-get install php-cli

Скопіюйте код з цієї сторінки і збережіть його до каталогу quanta-doc з назвою /usr/share/apps/quanta/doc/gendoc.php

Цей скрипт використовує php-XML-Reader. Через це вам слід скоригувати деякі з html відповідно до правил XML:

  • Відкрийте /usr/share/apps/quanta/doc/php/index.html і /usr/share/apps/quanta/doc/php/funcref.html
  • Змініть рядок
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

на

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  • Перейдіть до каталогу /usr/share/apps/quanta/doc/
  • Виконайте команду (від імені користувача root)
php gendoc.php php

Цей скрипт виконає оновлення php.docrc і створить php_fref.docrc.

php.docrc — файл звичайного покажчика документації до PHP.

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.

Щасти