Title: File Inliner
Author: kanma
Published: <strong>9 de juny de 2008</strong>
Last modified: 14 de maig de 2009

---

Cerca extensions

Aquesta extensió **no s’ha provat en les darreres 3 versions majors del WordPress**.
Segurament no està mantinguda o suportada, i pot tenir problemes de compatibilitat
quan s’usa en versions recents del WordPress.

![](https://s.w.org/plugins/geopattern-icon/file-inliner.svg)

# File Inliner

 Per [kanma](https://profiles.wordpress.org/kanma/)

[Baixa](https://downloads.wordpress.org/plugin/file-inliner.1.2.0.zip)

 * [Detalls](https://ca.wordpress.org/plugins/file-inliner/#description)
 * [Ressenyes](https://ca.wordpress.org/plugins/file-inliner/#reviews)
 *  [Instal·lació](https://ca.wordpress.org/plugins/file-inliner/#installation)
 * [Desenvolupament](https://ca.wordpress.org/plugins/file-inliner/#developers)

 [Suport](https://wordpress.org/support/plugin/file-inliner/)

## Descripció

This plugin displays the content of a file in a post. The content of the file
 (
called a «snippet») is put in a `<pre></pre>` block by default.

It has the following advantages over pasting the content of the file in your post

yourself:

 * When the file is modified, no need to modify the posts referring to it
 * Indentation is preserved by default (useful to show code snippets)
 * Can optionally provide a link to the file (no need to copy-paste your snippet)

If requested (see the `preserveformat` parameter), the content of the file
 is put
in a `<div></div>` block, with each line (delimited by the carriage return) in its
own `<p></p>` block.

#### Usage

Syntax: `[file lang="some_lang" start="a_line_number" end="a_line_number" link="
on_or_off" style="some_style_properties" preserveformat="on_or_off"]path/to/your/
file[/file]`

Note: The order of the attributes is mandatory!

#### Example: Inlining of a file

In your post, write `[file]path/to/your/file[/file]`. That’s it!

#### Example: Using a syntax highlighter plugin

If you write `[file lang="cpp"]path/to/your/file[/file]` (for instance),
 and if
the syntax highlighter plugin you use supports the `<pre lang="*"></pre>` syntax(
most does), then the content of your file will be processed by the syntax highlighter
plugin as usual.

#### Example: Provide a link to the file

If you write `[file link="on"]path/to/your/file[/file]`, a link will
 be automatically
added to the top left of the text area.

#### Example: Inline a subset of a file

If you write `[file start="10" end="20"]path/to/your/file[/file]`,
 only the lines
10 to 20 of the file will be displayed. You can omit the start (ie. «from beginning
to line 20») or the end (ie. «from line 10 to the end of the file») if you want.

#### Example: Set the color of the text to red

In your post, write `[file style="color: #FF0000;"]path/to/your/file[/file]`.

#### Example: Prevent the plugin to process a [file][/file] block

Just write `[file off]your content[/file]`.

Note: The ‘off’ attribute must come BEFORE any other ones.

## Captures

[⌊Inlining of a text file⌉⌊Inlining of a text file⌉[

Inlining of a text file

[⌊Inlining of a C++ file, with syntax highlighting (using CodeHighlighter)⌉⌊Inlining
of a C++ file, with syntax highlighting (using CodeHighlighter)⌉[

Inlining of a C++ file, with syntax highlighting (using CodeHighlighter)

[⌊Inlining of a Python file, with syntax highlighting (using CodeHighlighter),
and
a download link⌉⌊Inlining of a Python file, with syntax highlighting (using CodeHighlighter),

and a download link⌉[

Inlining of a Python file, with syntax highlighting (using CodeHighlighter), and
a download link

[⌊Inlining of some lines of a Python file, with syntax highlighting (using
CodeHighlighter),
and a download link⌉⌊Inlining of some lines of a Python file, with syntax highlighting(
using
CodeHighlighter), and a download link⌉[

Inlining of some lines of a Python file, with syntax highlighting (using CodeHighlighter),
and a download link

## Instal·lació

 1. Upload `fileinliner.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## PMF

  How is the content of the file retrieved by the plugin?

The PHP function
 [`file_get_contents`](http://fr.php.net/manual/en/function.file-get-contents.php)
is used. Your file must be readable by the web server.

  Can I use a URL instead of a path to the file?

From the [`file_get_contents`](http://fr.php.net/manual/en/function.file-get-contents.php)

documentation: A URL can be used as a filename with this function if the [fopen wrappers](http://fr.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen)
have been enabled.

Check your server configuration.

## Ressenyes

No hi ha ressenyes per a aquesta extensió.

## Col·laboradors i desenvolupadors

«File Inliner» és programari de codi obert. La següent gent ha col·laborat en aquesta
extensió.

Col·laboradors

 *   [ kanma ](https://profiles.wordpress.org/kanma/)

[Traduïu «File Inliner» a la vostra llengua.](https://translate.wordpress.org/projects/wp-plugins/file-inliner)

### Interessats en el desenvolupament?

[Navegueu pel codi](https://plugins.trac.wordpress.org/browser/file-inliner/), baixeu-
vos el [repositori SVN](https://plugins.svn.wordpress.org/file-inliner/), o subscriviu-
vos al [registre de desenvolupament](https://plugins.trac.wordpress.org/log/file-inliner/)
per [fisl de subscripció RSS](https://plugins.trac.wordpress.org/log/file-inliner/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Versió **1.2.0**
 *  Darrera actualització **fa 17 anys**
 *  Instal·lacions actives **10+**
 *  Versió del WordPress ** 2.0 o posterior **
 *  Provada fins a **2.7.1**
 *  Idioma
 * [English (US)](https://wordpress.org/plugins/file-inliner/)
 * Etiquetes
 * [code](https://ca.wordpress.org/plugins/tags/code/)[files](https://ca.wordpress.org/plugins/tags/files/)
   [inline](https://ca.wordpress.org/plugins/tags/inline/)[text](https://ca.wordpress.org/plugins/tags/text/)
 *  [Vista avançada](https://ca.wordpress.org/plugins/file-inliner/advanced/)

## Valoracions

Encara no s'ha enviat cap ressenya.

[Your review](https://wordpress.org/support/plugin/file-inliner/reviews/#new-post)

[Visualitzeu totes les ressenyes](https://wordpress.org/support/plugin/file-inliner/reviews/)

## Col·laboradors

 *   [ kanma ](https://profiles.wordpress.org/kanma/)

## Suport

Teniu quelcom a dir? Necessiteu ajuda?

 [Visualitza els fòrums de suport](https://wordpress.org/support/plugin/file-inliner/)