ckeditor/plugins/crossreference/README.md
changeset 5 c925ae656709
parent 2 467e24fbc60e
equal deleted inserted replaced
4:40e26009689c 5:c925ae656709
     3 
     3 
     4 Adds cross references links with optional auto-numeration for chapters, images, tables and references. Other types of references can be defined in config.
     4 Adds cross references links with optional auto-numeration for chapters, images, tables and references. Other types of references can be defined in config.
     5 
     5 
     6 ## Online demo
     6 ## Online demo
     7 
     7 
     8 Try the plugin demo at <http://indvd00m.com/crossreference/>.
     8 Try the plugin demo at <http://indvd00m.com/crossreference-demo/>.
       
     9 
       
    10 ## CKEditor plugin page
       
    11 
       
    12 http://ckeditor.com/addon/crossreference
       
    13 
       
    14 ## Requirements
       
    15 
       
    16 CrossReference Plugin require CKEditor 4.5+ version and dependent from plugins: dialog, notification.
       
    17 
       
    18 ## Installation
       
    19 
       
    20  1. Download the plugin: https://github.com/indvd00m/crossreference/releases.
       
    21  
       
    22  2. Extract (decompress) the downloaded file into the plugins folder of your
       
    23 	CKEditor installation.
       
    24 	Example: http://example.com/ckeditor/plugins/crossreference
       
    25 	
       
    26  3. Enable the plugin by using the extraPlugins configuration setting.
       
    27 	Example: CKEDITOR.config.extraPlugins = 'crossreference';
     9 
    28 
    10 ## Description
    29 ## Description
    11 
    30 
    12 Two main conceptions - anchor and link to anchor. There are 4 type of references defined by default: chapter, image, table, reference. Example of anchor of type `image` in raw html:
    31 Two main conceptions - anchor and link to anchor. There are 4 type of references defined by default: chapter, image, table, reference. Example of anchor of type `image` in raw html:
    13 ```html
    32 ```html
   120 ```
   139 ```
   121 | Property | Description | Type | Default value |
   140 | Property | Description | Type | Default value |
   122 | --- | --- | --- | --- |
   141 | --- | --- | --- | --- |
   123 | `activeTypes` | Which type of anchors would be activated. | Array | `['chapter', 'image', 'table', 'reference']` |
   142 | `activeTypes` | Which type of anchors would be activated. | Array | `['chapter', 'image', 'table', 'reference']` |
   124 | `overrideTypes` | If you define your own types, enabling this option lead to mixing of your types with types from default config which not yet defined in your config. | Boolean | false |
   143 | `overrideTypes` | If you define your own types, enabling this option lead to mixing of your types with types from default config which not yet defined in your config. | Boolean | false |
   125 | `types` | Types definition. | Object | see [Default config](https://github.com/indvd00m/crossreference#default-config) section|
   144 | `types` | Types definition. | Object | see [Example of type definition](https://github.com/indvd00m/crossreference#example-of-type-definition) section|
   126 
   145 
   127 ### Example of type definition
   146 ### Example of type definition
   128 
   147 
   129 ```javascript
   148 ```javascript
   130 image: {
   149 image: {
   148 | --- | --- | --- | --- |
   167 | --- | --- | --- | --- |
   149 | `name` | Type name. | String | Yes |
   168 | `name` | Type name. | String | Yes |
   150 | `anchorTextTemplate` | Template for anchor text. This text will be put in `a` tag. You can use variables in format `${variableName}`. Variables is a properties of an anchor object (see [Example of an anchor object](https://github.com/indvd00m/crossreference#example-of-an-anchor-object) section). | String | No |
   169 | `anchorTextTemplate` | Template for anchor text. This text will be put in `a` tag. You can use variables in format `${variableName}`. Variables is a properties of an anchor object (see [Example of an anchor object](https://github.com/indvd00m/crossreference#example-of-an-anchor-object) section). | String | No |
   151 | `linkTextTemplate` | Template for link text. This text will be put in `a` tag. You can use variables in format `${variableName}`. Variables is a properties of an anchor object (see [Example of an anchor object](https://github.com/indvd00m/crossreference#example-of-an-anchor-object) section). | String | No |
   170 | `linkTextTemplate` | Template for link text. This text will be put in `a` tag. You can use variables in format `${variableName}`. Variables is a properties of an anchor object (see [Example of an anchor object](https://github.com/indvd00m/crossreference#example-of-an-anchor-object) section). | String | No |
   152 | `numeration` | Definition of type numeration. See [Example of a numeration definition](https://github.com/indvd00m/crossreference#example-of-a-numeration-definition) section. | Object | No |
   171 | `numeration` | Definition of type numeration. See [Example of a numeration definition](https://github.com/indvd00m/crossreference#example-of-a-numeration-definition) section. | Object | No |
   153 | `anchorsProvider` | See [Example of type with anchors provider](https://github.com/indvd00m/crossreference#example-of-type-with-anchors-provider) section. | String 'default' or function | No |
   172 | `anchorsProvider` | See [Example of type with anchors provider](https://github.com/indvd00m/crossreference#example-of-type-with-anchors-provider) section. | String `'default'` or function | No |
   154 | `allowCreateAnchors` | Can user create anchors of this type in anchors dialog. | Boolean | No |
   173 | `allowCreateAnchors` | Can user create anchors of this type in anchors dialog. | Boolean | No |
   155 | `groupAnchors` | If `true`, anchors can be filtered by group in link dialog. | Boolean | No |
   174 | `groupAnchors` | If `true`, anchors can be filtered by group in link dialog. | Boolean | No |
   156 
   175 
   157 ### Example of a numeration definition
   176 ### Example of a numeration definition
   158 
   177 
   229 | `editorAnchors` | Anchors of this type (`myType` in this case) which already contains in editor. You can merge this anchors with your own anchors if need. | Array |
   248 | `editorAnchors` | Anchors of this type (`myType` in this case) which already contains in editor. You can merge this anchors with your own anchors if need. | Array |
   230 | `type` | Type definition (Object `myType` in this case). | Object |
   249 | `type` | Type definition (Object `myType` in this case). | Object |
   231 | `editor` | Instance of ckeditor. | Object |
   250 | `editor` | Instance of ckeditor. | Object |
   232 
   251 
   233 
   252 
   234 ## Requirements
       
   235 
       
   236 CrossReference Plugin require CKEditor 4.5+ version and dependent from plugins: dialog, notification.
       
   237 
       
   238 ## Installation
       
   239 
       
   240  1. Download the plugin: https://github.com/indvd00m/crossreference/releases.
       
   241  
       
   242  2. Extract (decompress) the downloaded file into the plugins folder of your
       
   243 	CKEditor installation.
       
   244 	Example: http://example.com/ckeditor/plugins/crossreference
       
   245 	
       
   246  3. Enable the plugin by using the extraPlugins configuration setting.
       
   247 	Example: CKEDITOR.config.extraPlugins = 'crossreference';
       
   248 
       
   249 ## Roadmap
   253 ## Roadmap
   250 
   254 
   251 See https://github.com/indvd00m/crossreference/issues.
   255 See https://github.com/indvd00m/crossreference/issues.
   252 
   256 
   253 ## Icons:
   257 ## Icons: