Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
1cb7b360
Commit
1cb7b360
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[server] include readmes on demand only
parent
d5e0d0a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/server/package.ml
+1
-4
1 addition, 4 deletions
src/plugins/server/package.ml
src/plugins/server/server_doc.ml
+12
-6
12 additions, 6 deletions
src/plugins/server/server_doc.ml
with
13 additions
and
10 deletions
src/plugins/server/package.ml
+
1
−
4
View file @
1cb7b360
...
@@ -327,10 +327,7 @@ let resolve_readme ~plugin = function
...
@@ -327,10 +327,7 @@ let resolve_readme ~plugin = function
Printf
.
sprintf
"%s/server/%s"
Fc_config
.
datadir
readme
Printf
.
sprintf
"%s/server/%s"
Fc_config
.
datadir
readme
|
Plugin
name
->
|
Plugin
name
->
Printf
.
sprintf
"%s/%s/server/%s"
Fc_config
.
datadir
name
readme
Printf
.
sprintf
"%s/%s/server/%s"
Fc_config
.
datadir
name
readme
in
in
Some
file
if
Sys
.
file_exists
file
then
Some
file
else
(
Senv
.
warning
"Can not find %S file"
file
;
None
)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- Declarations --- *)
(* --- Declarations --- *)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/server_doc.ml
+
12
−
6
View file @
1cb7b360
...
@@ -45,6 +45,7 @@ type page = {
...
@@ -45,6 +45,7 @@ type page = {
title
:
string
;
title
:
string
;
order
:
int
;
order
:
int
;
descr
:
Markdown
.
elements
;
descr
:
Markdown
.
elements
;
readme
:
string
option
;
mutable
sections
:
section
list
;
mutable
sections
:
section
list
;
}
}
...
@@ -74,12 +75,9 @@ let page chapter ~title ?(descr=[]) ?readme ~filename () =
...
@@ -74,12 +75,9 @@ let page chapter ~title ?(descr=[]) ?readme ~filename () =
Senv
.
failure
"Duplicate page '%s' path@."
path
;
other
Senv
.
failure
"Duplicate page '%s' path@."
path
;
other
with
Not_found
->
with
Not_found
->
let
order
=
incr
order
;
!
order
in
let
order
=
incr
order
;
!
order
in
let
descr
=
match
readme
with
|
None
->
Markdown
.
section
~
title
descr
|
Some
file
->
Markdown
.
rawfile
file
@
descr
in
let
page
=
{
let
page
=
{
order
;
rootdir
;
path
;
order
;
rootdir
;
path
;
chapter
;
title
;
descr
;
chapter
;
title
;
descr
;
readme
;
sections
=
[]
;
sections
=
[]
;
}
in
}
in
pages
:=
Pages
.
add
path
page
!
pages
;
page
pages
:=
Pages
.
add
path
page
!
pages
;
page
...
@@ -323,9 +321,17 @@ let dump ~root ?(meta=true) () =
...
@@ -323,9 +321,17 @@ let dump ~root ?(meta=true) () =
Pages
.
iter
Pages
.
iter
(
fun
path
page
->
(
fun
path
page
->
Senv
.
feedback
"[doc] Page: '%s'"
path
;
Senv
.
feedback
"[doc] Page: '%s'"
path
;
let
body
=
Markdown
.
subsections
page
.
descr
(
build
[]
page
.
sections
)
in
let
title
=
page
.
title
in
let
title
=
page
.
title
in
pp_one_page
~
root
~
page
:
path
~
title
body
;
let
intro
=
match
page
.
readme
with
|
None
->
Markdown
.
section
~
title
page
.
descr
|
Some
file
->
if
Sys
.
file_exists
file
then
Markdown
.
rawfile
file
@
page
.
descr
else
(
Senv
.
warning
"Can not find %S file"
file
;
Markdown
.
section
~
title
page
.
descr
)
in
let
body
=
Markdown
.
subsections
page
.
descr
(
build
[]
page
.
sections
)
in
pp_one_page
~
root
~
page
:
path
~
title
(
intro
@
body
)
;
if
meta
then
if
meta
then
let
path
=
Printf
.
sprintf
"%s/%s.json"
root
path
in
let
path
=
Printf
.
sprintf
"%s/%s.json"
root
path
in
Yojson
.
Basic
.
to_file
path
(
metadata
page
)
;
Yojson
.
Basic
.
to_file
path
(
metadata
page
)
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment