PukiWiki改造/SC改行改段書式
をテンプレートにして作成
[
凌宮
|
初基
|
一覧
|
検索
|
最新
] [
ソース
]
開始行:
/SC改行改段書式の導入
#indent
#contents
/////////////////////////////////////////////////////////...
* 方針 [#l9134ee3]
- 従来の行末にある「~」で行われる改行は、行頭書式に統一す...
-- 統一した場合、Wikiコードから書式を読むとき、行頭の縦読...
-- Wikiの行末書式は「~」しかない ⇔ 行頭書式が殆ど
- 行頭が「##;##」で始まる「SC改行改段書式/SemiColon改行...
-- 多くのプログラミングで用いられる文終了記号「##;##」を...
/////////////////////////////////////////////////////////...
* 仕様 [#b00c412d]
- 行頭が「##;.##」の行は無書式として、何もせずに前の行に...
- 行頭が「##;,##」の行は行頭で改行する。
- 行頭が「##;:##」の行は行頭で改段する。空行を挿入せず、...
- 行頭が「##;;##」の行は行頭で改段する。空行を挿入し、他...
- 行頭が「##;##」 は改行の省略表現。(文節区切りで改行す...
- 行頭改行が段頭に来た場合は無効化する。
- 区切りの強いさは、点の大きさと数に比例する。
-- Cなど多くのプログラミング言語での区切りの強い順になっ...
-- 「##.##」はPHPでは文字列連結演算子に使われる ⇒ 行結合
/////////////////////////////////////////////////////////...
* 改造 [#g974592b]
- ##lib/convert_html.php## で、
;.##class Body## の
;.##function parse## の
;.##while (!empty($lines))## 中の下の方に以下のコードを変...
;,これより、段頭の改行が無効化される。
### diff
// Body
class Body extends Element
{
...
function parse(& $lines)
{
...
while (!empty($lines))
{
...
// The first character
- $head = $line{0};
+ $head = substr($line,0,1);
+ $head2 = substr($line,0,2);
+
+ // ; Format
+ if ($head2 == ';.') {// SCNF: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';,') {// SCNL: SemiCcolon-...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';:') {// SCNP: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';;') {// SCNP: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head == ';') {// SCNL: SemiCcolon-Ne...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
###
-- 「##-##」で始まる行は ##class Body## からの削除。
-- 「##+##」で始まる行は ##class Body## への追加。
- ##lib/convert_html.php## で、
;.##class Inline## の
;.##function & toPara## に以下のコードを挿入。
### diff
class Inline extends Element
{
...
function & toPara($class = '')
{
$obj = & new Paragraph('', $class);
$obj->insert($this);
+
+ if (substr($this->elements[0],0,6)=='<br />')...
+ $this->elements[0] = substr($this->elemen...
+ }
return $obj;
}
}
###
/////////////////////////////////////////////////////////...
終了行:
/SC改行改段書式の導入
#indent
#contents
/////////////////////////////////////////////////////////...
* 方針 [#l9134ee3]
- 従来の行末にある「~」で行われる改行は、行頭書式に統一す...
-- 統一した場合、Wikiコードから書式を読むとき、行頭の縦読...
-- Wikiの行末書式は「~」しかない ⇔ 行頭書式が殆ど
- 行頭が「##;##」で始まる「SC改行改段書式/SemiColon改行...
-- 多くのプログラミングで用いられる文終了記号「##;##」を...
/////////////////////////////////////////////////////////...
* 仕様 [#b00c412d]
- 行頭が「##;.##」の行は無書式として、何もせずに前の行に...
- 行頭が「##;,##」の行は行頭で改行する。
- 行頭が「##;:##」の行は行頭で改段する。空行を挿入せず、...
- 行頭が「##;;##」の行は行頭で改段する。空行を挿入し、他...
- 行頭が「##;##」 は改行の省略表現。(文節区切りで改行す...
- 行頭改行が段頭に来た場合は無効化する。
- 区切りの強いさは、点の大きさと数に比例する。
-- Cなど多くのプログラミング言語での区切りの強い順になっ...
-- 「##.##」はPHPでは文字列連結演算子に使われる ⇒ 行結合
/////////////////////////////////////////////////////////...
* 改造 [#g974592b]
- ##lib/convert_html.php## で、
;.##class Body## の
;.##function parse## の
;.##while (!empty($lines))## 中の下の方に以下のコードを変...
;,これより、段頭の改行が無効化される。
### diff
// Body
class Body extends Element
{
...
function parse(& $lines)
{
...
while (!empty($lines))
{
...
// The first character
- $head = $line{0};
+ $head = substr($line,0,1);
+ $head2 = substr($line,0,2);
+
+ // ; Format
+ if ($head2 == ';.') {// SCNF: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';,') {// SCNL: SemiCcolon-...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';:') {// SCNP: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head2 == ';;') {// SCNP: SemiColon-N...
+ $this->last = & $this->last->add(new ...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
+ if ($head == ';') {// SCNL: SemiCcolon-Ne...
+ $this->last = & $this->last->add(new ...
+ continue;
+ }
###
-- 「##-##」で始まる行は ##class Body## からの削除。
-- 「##+##」で始まる行は ##class Body## への追加。
- ##lib/convert_html.php## で、
;.##class Inline## の
;.##function & toPara## に以下のコードを挿入。
### diff
class Inline extends Element
{
...
function & toPara($class = '')
{
$obj = & new Paragraph('', $class);
$obj->insert($this);
+
+ if (substr($this->elements[0],0,6)=='<br />')...
+ $this->elements[0] = substr($this->elemen...
+ }
return $obj;
}
}
###
/////////////////////////////////////////////////////////...
ページ名:
Anatomy_of_the_Human_Ear_ja.svg
365件
[
詳細
]
line.pukiwiki.php
460件
[
詳細
]
line.diff.php
449件
[
詳細
]
inline.tex
439件
[
詳細
]
convert_html.php
472件
[
詳細
]
eq.inc.php
508件
[
詳細
]
convert.tex
423件
[
詳細
]
codehighlight.php
438件
[
詳細
]
code.inc.php
476件
[
詳細
]
ToHeader.png
234件
[
詳細
]
ToFooter_0.png
202件
[
詳細
]
ToFooter.png
239件
[
詳細
]
ParaEdit.png
245件
[
詳細
]
TexEqMiddleAlign.png
485件
[
詳細
]
[
凌宮
|
初基
|
一覧
|
検索
|
最新
] [
ソース
]