Skip to content

Commit 24e6754

Browse files
rhornigavarga
authored andcommitted
User's Guide instead of manual
1 parent 23f745c commit 24e6754

12 files changed

+366
-89
lines changed

Diff for: DocumentationGuidelines.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ underMenu: Development
66

77
We maintain documentation in the following forms:
88

9-
* **INET Framework Manual** is meant to provide an overview about the components and architecture of the framework
9+
* **INET Framework User's Guide** is meant to provide information for users who want to assemble new models from pre-existing components. It provides an overview of the components and architecture of the framework.
10+
<!-- * **INET Framework Developer's Guide** is meant to provide information for the developers who intend to extend INET with new components, written in C++. -->
1011
* **INET Reference**, built from NED and C++ source, provides cross-linked, browsable reference information about the modules and classes of the implementation
1112

1213
The following auxiliary files are managed by the core INET maintainers:
@@ -15,22 +16,22 @@ The following auxiliary files are managed by the core INET maintainers:
1516
* **WHATSNEW** (in the project root directory) is updated before each release, and contains a summary of changes in the whole framework.
1617
* **AUTHORS** (in the project root directory) records the names of those who contributed to the project. The [Contributors](/Contributors.html) page should always contain a mirror of this file.
1718

18-
## The Manual
19+
## The User's Guide
1920

2021
Technically:
2122

22-
* Sources are in the repository under [doc/src/manual][2], in LaTeX.
23+
* Sources are in the repository under [doc/src/users-guide][2], in LaTeX.
2324
* PDF and/or HTML built by the release manager for each release
2425

2526
Content and level of details:
2627

27-
* The purpose of the Manual is to provide introductory and overview information for newcomers, and give a high-level overview of the architecture and important internal APIs for contributors.
28-
* High-level information about every implemented protocol model or component, potentially including practical advice on how to use them or combine them with other models
29-
* High-level overview of internal interfaces, such as cross-layer communication
28+
* The purpose of the User's Guide is to provide introductory and overview information for newcomers, and give a high-level overview of the architecture and configuration options.
29+
* High-level information about every implemented protocol model or component, potentially including practical advice on how to use them or combine them with other models.
3030

3131
However, it should not:
3232

3333
* Be as detailed as to duplicate information in the Reference
34+
* Describe internal interfaces that are used by C++ code.
3435
* Attempt to teach or describe the protocol itself (that's not the job of the manual)
3536

3637
## The Reference

Diff for: Manual.md

-11
This file was deleted.

Diff for: UsersGuide.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: page
3+
title: User's Guide
4+
underMenu: Documentation
5+
---
6+
7+
The User's Guide is currently in preparation. It provides an overview of the concepts, architecture, and main
8+
components of the INET Framework, and it is meant to be used with the Reference.
9+
10+
You can read the current version of the User's Guide [here][4].
11+
12+
Helping hands on the INET documentation would be very much appreciated. More info [here][3].
13+
14+
[3]: DocumentationGuidelines.html
15+
[4]: https://omnetpp.org/doc/inet/api-current/inet-users-guide.pdf

Diff for: _data/menu.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
- name: Model Catalog
2020
link: /Protocols.html
2121
- name: INET Reference
22-
link: http://omnetpp.org/doc/inet/api-current
23-
- name: INET Manual
24-
link: /Manual.html
22+
link: https://omnetpp.org/doc/inet/api-current
23+
- name: INET User's Guide
24+
link: /userguide/inet-users-guide.html
2525
- separator: true
2626
- name: 3rd Party Tutorials
2727
link: /Tutorials.html

Diff for: _layouts/default.html

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<link rel="stylesheet" href="/stylesheets/bootstrap-cerulean.min.css" media="screen">
88
<link rel="stylesheet" href="/stylesheets/inet.css">
9+
<link rel="stylesheet" href="{{site.baseurl}}/stylesheets/rainbow.css">
910
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
1011
<!--[if lt IE 9]>
1112
<script src="javascripts/html5shiv.js"></script>
@@ -41,6 +42,16 @@
4142
ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } /* open menus on hover */
4243
.navbar { border-bottom: 4px solid #ff8800; } /* minimal styling: orange strip under navbar */
4344
.frontpage h3 { border-bottom: 4px solid #ff8800; padding-bottom: 3px; }
45+
46+
table.matrix { display:inline-block; vertical-align: middle; position: relative; border: 0px; background:#ffffff; margin-left:8pt; margin-right:8pt; }
47+
table.matrix:before, table.matrix:after { content: ""; position: absolute; top: 0; border: 1px solid #000; width: 6px; height: 100%; }
48+
table.matrix:before { left: -6px; border-right: 0px; }
49+
table.matrix:after { right: -6px; border-left: 0px; }
50+
table.matrix td { padding: 5px; text-align: center; border: 0px; }
51+
52+
a.headerlink { visibility: hidden; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; color: #82A3AF; }
53+
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink { visibility: visible; }
54+
4455
</style>
4556
</head>
4657
<body {% if page.generateToC %}onload="generateToC();" data-spy="scroll" data-target=".bs-docs-sidebar"{% endif %}{% if page.frontpage %} class="frontpage"{% endif %}>
@@ -113,6 +124,11 @@
113124
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
114125
<script src="/javascripts/bootstrap.min.js"></script>
115126
<script src="/javascripts/cerulean.js"></script>
127+
<script src="{{site.baseurl}}/javascripts/quoting.js"></script>
128+
<script src="{{site.baseurl}}/javascripts/rainbow-custom.min.js"></script>
129+
<script src="{{site.baseurl}}/javascripts/rainbow-ned.js"></script>
130+
<script src="{{site.baseurl}}/javascripts/rainbow-ini.js"></script>
131+
<script src="{{site.baseurl}}/javascripts/rainbow-html.js"></script>
116132
</body>
117133
</html>
118134

Diff for: javascripts/quoting.js

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
//
2+
// Allows including a line range of a file from HTML. Example:
3+
//
4+
// <pre src="../WirelessA.ned" from="network WirelessA" until="####"></pre>
5+
//
6+
// "from", "until" are regexes that match substring of a line; "from" is inclusive, "until" is exclusive
7+
//
8+
// Returns an object/dictionary/map with two values:
9+
// startLine - the line number where the returned snippet begins in the whole text (starting from 1 as usual...)
10+
// snippet - the actual matched snippet text
11+
var getLines = function(text, after, from, until, upto, comment) {
12+
13+
let startPattern = from == null ? after : from;
14+
let isStartInclusive = from != null;
15+
16+
let endPattern = until == null ? upto : until;
17+
let isEndInclusive = upto != null;
18+
19+
if (startPattern == null) {
20+
startPattern = "";
21+
isStartInclusive = true;
22+
}
23+
24+
if (endPattern == null) {
25+
endPattern = "[\\s\\S]*";
26+
isEndInclusive = true;
27+
}
28+
29+
let re = new RegExp("([\\s\\S]*?)(^.*" + startPattern + ".*$\\n)([\\s\\S]*?)(^.*" + endPattern + ".*$)", "m");
30+
31+
let matches = text.match(re);
32+
33+
// Group 1 is the "preface" - everything before the snippet.
34+
// Group 2 is the lines enclosing the start marker
35+
// Group 3 is the snippet "body"
36+
// Group 4 is the lines enclosing the end marker
37+
if (matches == null)
38+
return { startLine: 0, snippet: "!!! No matching lines !!!" };
39+
40+
let preface = isStartInclusive ? matches[1] : (matches[1] + matches[2]);
41+
let snippet = (isStartInclusive ? matches[2] : "")
42+
+ matches[3]
43+
+ (isEndInclusive ? matches[4] : "");
44+
45+
startLine = preface.split('\n').length;
46+
47+
// trimming trailing whitespace (empty lines)
48+
snippet = snippet.replace(/\s+$/, '');
49+
50+
if (comment) // [^\S\n] character class is a "double-negative": matches any whitespace, except a newline
51+
snippet = snippet.replace(new RegExp("[^\\S\\n]*" + comment + ".*$", "mg"), '');
52+
53+
return { startLine: startLine, snippet: snippet };
54+
}
55+
56+
var fileLoaded = function(file, data) {
57+
pres = $('pre[src="' + file + '"]');
58+
$.each(pres, function(i,pre) {
59+
pre.textContent = "";
60+
excerpt = getLines(data,
61+
pre.attributes.after ? pre.attributes.after.value : null,
62+
pre.attributes.from ? pre.attributes.from.value : null,
63+
pre.attributes.until ? pre.attributes.until.value : null,
64+
pre.attributes.upto ? pre.attributes.upto.value : null,
65+
pre.attributes.comment ? pre.attributes.comment.value : null);
66+
67+
var language = file.endsWith(".ned") ? "ned" : file.endsWith(".xml") ? "xml"
68+
: file.endsWith(".ini") ? "ini" : file.endsWith(".py") ? "python"
69+
: file.endsWith("Dockerfile") ? "dockerfile" : "generic";
70+
71+
// this new element will hold some attributes to aid Rainbow and Rainbow.linenumbers, as well as the snippet content.
72+
var codeElement = document.createElement('code');
73+
codeElement.setAttribute('display', 'none'); // so it won't appear unformatted
74+
codeElement.setAttribute('data-language', language); // used by Rainbow
75+
codeElement.setAttribute('data-line', excerpt.startLine); // used by Rainbow.linenumbers
76+
$(codeElement).text(excerpt.snippet); // making sure we escape it
77+
pre.appendChild(codeElement); // adding the <code> to the DOM
78+
79+
// And then invoke the highlighter on the containing <pre>.
80+
// The Rainbow.linenumbers plugin will replace the <code> with a <table>.
81+
Rainbow.color(pre);
82+
});
83+
};
84+
85+
document.addEventListener("DOMContentLoaded", function (event) {
86+
pres = $('pre[src]');
87+
files = new Set();
88+
$.each(pres, function(i,pre) {pre.textContent="Loading...\n"; files.add(pre.attributes.src.value); });
89+
90+
91+
files.forEach(function(file) {
92+
jQuery.ajax({url: file,
93+
success: function(data) { fileLoaded(file, data); },
94+
dataType: "text" });
95+
});
96+
});

Diff for: javascripts/rainbow-custom.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: javascripts/rainbow-html.js

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/**
2+
* HTML patterns
3+
*
4+
* @author Craig Campbell
5+
*/
6+
Rainbow.extend('html', [
7+
{
8+
name: 'source.php.embedded',
9+
matches: {
10+
1: 'variable.language.php-tag',
11+
2: {
12+
language: 'php'
13+
},
14+
3: 'variable.language.php-tag'
15+
},
16+
pattern: /(&lt;\?php|&lt;\?=?(?!xml))([\s\S]*?)(\?&gt;)/gm
17+
},
18+
{
19+
name: 'source.css.embedded',
20+
matches: {
21+
1: {
22+
matches: {
23+
1: 'support.tag.style',
24+
2: [
25+
{
26+
name: 'entity.tag.style',
27+
pattern: /^style/g
28+
},
29+
{
30+
name: 'string',
31+
pattern: /('|")(.*?)(\1)/g
32+
},
33+
{
34+
name: 'entity.tag.style.attribute',
35+
pattern: /(\w+)/g
36+
}
37+
],
38+
3: 'support.tag.style'
39+
},
40+
pattern: /(&lt;\/?)(style.*?)(&gt;)/g
41+
},
42+
2: {
43+
language: 'css'
44+
},
45+
3: 'support.tag.style',
46+
4: 'entity.tag.style',
47+
5: 'support.tag.style'
48+
},
49+
pattern: /(&lt;style.*?&gt;)([\s\S]*?)(&lt;\/)(style)(&gt;)/gm
50+
},
51+
{
52+
name: 'source.js.embedded',
53+
matches: {
54+
1: {
55+
matches: {
56+
1: 'support.tag.script',
57+
2: [
58+
{
59+
name: 'entity.tag.script',
60+
pattern: /^script/g
61+
},
62+
63+
{
64+
name: 'string',
65+
pattern: /('|")(.*?)(\1)/g
66+
},
67+
{
68+
name: 'entity.tag.script.attribute',
69+
pattern: /(\w+)/g
70+
}
71+
],
72+
3: 'support.tag.script'
73+
},
74+
pattern: /(&lt;\/?)(script.*?)(&gt;)/g
75+
},
76+
2: {
77+
language: 'javascript'
78+
},
79+
3: 'support.tag.script',
80+
4: 'entity.tag.script',
81+
5: 'support.tag.script'
82+
},
83+
pattern: /(&lt;script(?! src).*?&gt;)([\s\S]*?)(&lt;\/)(script)(&gt;)/gm
84+
},
85+
{
86+
name: 'comment.html',
87+
pattern: /&lt;\!--[\S\s]*?--&gt;/g
88+
},
89+
{
90+
matches: {
91+
1: 'support.tag.opening',
92+
2: 'support.tag.closing'
93+
},
94+
pattern: /(&lt;)|(\/?\??&gt;)/g
95+
},
96+
{
97+
name: 'support.tag',
98+
matches: {
99+
1: 'support.tag',
100+
2: 'support.tag.special',
101+
3: 'support.tag-name'
102+
},
103+
pattern: /(&lt;\??)(\/|\!?)(\w+)/g
104+
},
105+
{
106+
matches: {
107+
1: 'support.attribute'
108+
},
109+
pattern: /([a-z-]+)(?=\=)/gi
110+
},
111+
{
112+
matches: {
113+
1: 'support.operator',
114+
2: 'string.quote',
115+
3: 'string.value',
116+
4: 'string.quote'
117+
},
118+
pattern: /(=)('|")(.*?)(\2)/g
119+
},
120+
{
121+
matches: {
122+
1: 'support.operator',
123+
2: 'support.value'
124+
},
125+
pattern: /(=)([a-zA-Z\-0-9]*)\b/g
126+
},
127+
{
128+
matches: {
129+
1: 'support.attribute'
130+
},
131+
pattern: /\s([\w-]+)(?=\s|&gt;)(?![\s\S]*&lt;)/g
132+
}
133+
]);
134+
135+
Rainbow.addAlias('xml', 'html');

0 commit comments

Comments
 (0)