整形ルール (pre形式指定符号)

pre形式指定符号の書式

「`」符号

動作

「`」符号で囲まれた文字列は<code> タグで整形されて表示されます。

表示例1

`https://www.ipentec.com`

https://www.ipentec.com

表示例1

`https://www.ipentec.com`~
URLです。~

https://www.ipentec.com
URLです。

表示例2

URLはこちら`https://www.ipentec.com`です。

URLはこちらhttps://www.ipentec.comです。

表示例3

URLはこちら
`
https://www.ipentec.com
`
です。

URLはこちら ` https://www.ipentec.com ` です。

表示例4

URLはこちら~
`https://www.ipentec.com/document/format-rule-pre`~
です。

URLはこちら
https://www.ipentec.com/document/format-rule-pre
です。

表示例5 (複数行)

`
https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net
`

` https://www.ipentec.com https://www.ipentec.jp https://www.ipentec.net `

表示例6 (複数行 改行)

`
https://www.ipentec.com~
https://www.ipentec.jp~
https://www.ipentec.net~
`

` https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net
`

`
int,~
string,~
char~
`

` int,
string,
char
`

注意
この記述は表示が崩れるため、基本的に不可です。

「``」符号

動作

「``」符号で囲まれた文字列は<pre> タグで整形されて表示されます。

表示例1

URLはこちら``https://www.ipentec.com``です。

URLはこちらhttps://www.ipentec.comです。

表示例2 (複数行)

``
https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net
``

https://www.ipentec.com https://www.ipentec.jp https://www.ipentec.net

表示例3 (複数行 改行)

``
https://www.ipentec.com~
https://www.ipentec.jp~
https://www.ipentec.net~
``

https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net

表示例4

``
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
``

 private void CreateLiteral(string Text, ControlCollection target)
 {
   LiteralControl lc = new LiteralControl();
   lc.Text = Text;
   target.Add(lc);
 }

メモ
preタグで整形されるため、改行も含めて入力された文字がそのまま表示されます。

「```」符号

動作

「```」符号で囲まれた文字列は<pre></pre> タグで整形されて表示されます。

表示例1

URLはこちら```https://www.ipentec.com```です。
URLはこちら
https://www.ipentec.com
です。

表示例2 (複数行)

```
https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net
```
https://www.ipentec.com
https://www.ipentec.jp
https://www.ipentec.net

表示例3 (複数行 改行)

```
https://www.ipentec.com~
https://www.ipentec.jp~
https://www.ipentec.net~
```
https://www.ipentec.com~
https://www.ipentec.jp~
https://www.ipentec.net~

表示例4

```
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
```
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }

表示例5 (HTMLタグを記述する場合)

```
 <div>ABCDEFG</div>
 <p>あいうえおかき</p>
```
 <div>ABCDEFG</div>
 <p>あいうえおかき</p>
メモ
preタグ内にcodeタグで整形されますが、画面での見た目はほぼ変わりません。コードであることを明示するために利用します。

pre タグ直接記述

表示例1

#[[pre class="brush:csharp"]]
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
#[[/pre]]
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
[|function|]
#[[[pre class="brush:csharp"]]
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
#[[/pre]]

function
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }

表示例2

#[[pre]]
  if (a==10){
    break;
  }
#[[/pre]]
  if (a<=10){
    break;
  }






廃止となった記述

pre 形式指定符号

クラス指定なし

表示例1
#pre{
C:\Windows\System32
}#
#pre{

C:\Windows\System32 }#

表示例2
#pre{
C:\Windows\System32
}#
#pre{

C:\Windows\System32 }#

クラス指定あり

#pre(class="mystyle"){
C:\Windows\System32
}#
#pre(class="mystyle"){

C:\Windows\System32 }#

code 形式指定符号

表示例1

#code{if else}#
#code{if else}#

表示例2

新しい変数を#code{int[]}#で宣言します。
新しい変数を#code{int[]}#で宣言します。

表示例3 (表示が崩れる例)

#code{
int,
string,
char
}#
#code{

int, string, char }#

precode 形式指定符号

クラス指定なし

表示例1
#precode{
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
}#
#precode{
 private void CreateLiteral(string Text, ControlCollection target)
 {
   LiteralControl lc = new LiteralControl();
   lc.Text = Text;
   target.Add(lc);
 }

}#

表示例2
#precode(preclass="CodeHighlighter",codeclass="csharp"){
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
}#
#precode(preclass="CodeHighlighter",codeclass="csharp"){
 private void CreateLiteral(string Text, ControlCollection target)
 {
   LiteralControl lc = new LiteralControl();
   lc.Text = Text;
   target.Add(lc);
 }

}#

クラス指定あり

#precode(preclass="CodeHighlighter",codeclass="csharp"){
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
}#
#precode(preclass="CodeHighlighter",codeclass="csharp"){
 private void CreateLiteral(string Text, ControlCollection target)
 {
   LiteralControl lc = new LiteralControl();
   lc.Text = Text;
   target.Add(lc);
 }

}#

[|function|]
#precode(preclass="CodeHighlighter",codeclass="csharp"){
  private void CreateLiteral(string Text, ControlCollection target)
  {
    LiteralControl lc = new LiteralControl();
    lc.Text = Text;
    target.Add(lc);
  }
}#

function

#precode(preclass="CodeHighlighter",codeclass="csharp"){
 private void CreateLiteral(string Text, ControlCollection target)
 {
   LiteralControl lc = new LiteralControl();
   lc.Text = Text;
   target.Add(lc);
 }

}#


AuthorPortraitAlt
著者
挿絵などのお絵描き担当。以前はオタクライフにどっぷりつかっていたが、最近は体力が衰えたためかやや引き気味。
現在も趣味で細々と制作活動中。
作成日: 2018-01-23
Copyright © 1995–2025 iPentec all rights reserverd.