Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
8ff1c4cb
Commit
8ff1c4cb
authored
Sep 23, 2007
by
jepso
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed interdocumentation linking feature
parent
d8525ca0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
14 deletions
+60
-14
Doclink.php
manual/new/lib/Text/Wiki/Parse/Doc/Doclink.php
+4
-1
Doclink.php
manual/new/lib/Text/Wiki/Render/Latex/Doclink.php
+8
-0
Heading.php
manual/new/lib/Text/Wiki/Render/Latex/Heading.php
+13
-5
Xhtml.php
vendor/Sensei/Sensei/Doc/Renderer/Xhtml.php
+13
-4
Section.php
vendor/Sensei/Sensei/Doc/Section.php
+22
-4
No files found.
manual/new/lib/Text/Wiki/Parse/Doc/Doclink.php
View file @
8ff1c4cb
...
...
@@ -32,8 +32,11 @@ class Text_Wiki_Parse_Doclink extends Text_Wiki_Parse {
if
(
isset
(
$matches
[
2
]))
{
$options
[
'text'
]
=
$matches
[
2
];
$options
[
'text'
]
=
str_replace
(
':index'
,
$section
->
getIndex
(),
$options
[
'text'
]);
$options
[
'text'
]
=
str_replace
(
':name'
,
$section
->
getName
(),
$options
[
'text'
]);
$options
[
'text'
]
=
str_replace
(
':fullname'
,
$section
->
getName
(
true
),
$options
[
'text'
]);
}
else
{
$options
[
'text'
]
=
$section
->
getIndex
()
.
' '
.
$section
->
getName
(
true
)
;
$options
[
'text'
]
=
$section
->
getIndex
();
}
return
$this
->
wiki
->
addToken
(
$this
->
rule
,
$options
);
...
...
manual/new/lib/Text/Wiki/Render/Latex/Doclink.php
0 → 100644
View file @
8ff1c4cb
<?php
class
Text_Wiki_Render_Latex_Doclink
extends
Text_Wiki_Render
{
function
token
(
$options
)
{
return
'\ref{'
.
$options
[
'path'
]
.
'}'
;
}
}
manual/new/lib/Text/Wiki/Render/Latex/Heading.php
View file @
8ff1c4cb
...
...
@@ -4,12 +4,19 @@ class Text_Wiki_Render_Latex_Heading extends Text_Wiki_Render {
function
token
(
$options
)
{
static
$label
=
array
();
// get nice variable names (type, level)
extract
(
$options
);
if
(
$type
==
'start'
)
{
switch
(
$level
)
{
while
(
count
(
$label
)
>=
$level
)
{
array_pop
(
$label
);
}
$label
[]
=
Sensei_Doc_Section
::
convertNameToPath
(
$text
);
switch
(
$level
)
{
case
'1'
:
return
'\chapter{'
;
case
'2'
:
...
...
@@ -22,12 +29,13 @@ class Text_Wiki_Render_Latex_Heading extends Text_Wiki_Render {
return
'\paragraph{'
;
case
'6'
:
return
'\subparagraph{'
;
}
}
}
if
(
$type
==
'end'
)
{
return
"}
\n
"
;
return
"}
\n
\label{"
.
implode
(
':'
,
$label
)
.
"}
\n
"
;
}
}
}
?>
\ No newline at end of file
?>
vendor/Sensei/Sensei/Doc/Renderer/Xhtml.php
View file @
8ff1c4cb
...
...
@@ -187,12 +187,17 @@ class Sensei_Doc_Renderer_Xhtml extends Sensei_Doc_Renderer
return
$output
;
}
public
function
makeUrl
(
Sensei_Doc_Section
$section
)
public
function
makeUrl
(
$section
)
{
if
(
$section
instanceof
Sensei_Doc_Section
)
{
$path
=
$section
->
getPath
();
}
else
{
$path
=
$section
;
}
$url
=
$this
->
_options
[
'url_prefix'
];
if
(
$this
->
_options
[
'section'
]
instanceof
Sensei_Doc_Section
)
{
$path
=
$section
->
getPath
();
$level
=
$this
->
_options
[
'section'
]
->
getLevel
();
$url
.=
implode
(
':'
,
array_slice
(
explode
(
':'
,
$path
),
0
,
$level
));
}
...
...
@@ -205,9 +210,13 @@ class Sensei_Doc_Renderer_Xhtml extends Sensei_Doc_Renderer
return
$url
;
}
public
function
makeAnchor
(
Sensei_Doc_Section
$section
)
public
function
makeAnchor
(
$section
)
{
$path
=
$section
->
getPath
();
if
(
$section
instanceof
Sensei_Doc_Section
)
{
$path
=
$section
->
getPath
();
}
else
{
$path
=
$section
;
}
if
(
$this
->
_options
[
'section'
]
instanceof
Sensei_Doc_Section
)
{
$level
=
$this
->
_options
[
'section'
]
->
getLevel
();
...
...
vendor/Sensei/Sensei/Doc/Section.php
View file @
8ff1c4cb
...
...
@@ -114,9 +114,9 @@ class Sensei_Doc_Section implements Countable
public
function
getIndex
(
$separator
=
'.'
)
{
if
(
$this
->
_parent
->
_name
!==
null
)
{
return
$this
->
_parent
->
getIndex
(
$separator
)
.
(
$this
->
_index
+
1
)
.
$separator
;
return
$this
->
_parent
->
getIndex
(
$separator
)
.
$separator
.
(
$this
->
_index
+
1
)
;
}
else
{
return
(
$this
->
_index
+
1
)
.
$separator
;
return
(
$this
->
_index
+
1
);
}
}
...
...
@@ -136,7 +136,7 @@ class Sensei_Doc_Section implements Countable
$path
=
preg_replace
(
$patterns
,
$replacements
,
strtolower
(
$this
->
_name
));
return
$path
;
return
self
::
convertNameToPath
(
$this
->
_name
)
;
}
}
...
...
@@ -385,4 +385,22 @@ class Sensei_Doc_Section implements Countable
}
}
}
}
\ No newline at end of file
/**
* Converts section name to section path.
*
* Section path is generated from section name by making section name
* lowercase, replacing all whitespace with a dash and removing all
* characters that are not a letter, a number or a dash.
*
* @param $name string section name
* @return section path
*/
public
static
function
convertNameToPath
(
$name
)
{
$patterns
=
array
(
'/\s/'
,
'/[^a-z0-9-]/'
);
$replacements
=
array
(
'-'
,
''
);
return
preg_replace
(
$patterns
,
$replacements
,
strtolower
(
$name
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment