Commit 1bde6660 authored by Jerediah Fevold's avatar Jerediah Fevold
Browse files

Added cover page insterter and table of contents generator, updated the CSS...

Added cover page insterter and table of contents generator, updated the CSS stylesheet, and removed the cover page and table of contents from the base version of 38.331-i00.
parent 62d53bb1
Loading
Loading
Loading
Loading
+0 −2869

File changed.

Preview size limit exceeded, changes collapsed.

+58 −0
Original line number Diff line number Diff line
<p style="text-align:right; margin:0;"><span style="font-size: 42px;">3GPP TS 38.331</span> <span style="font-size: 26px;">V18.0.0</span> <span style="font-size: 21px;">(2023-12)</span></p>
<hr />
<p style="font-size: 13px; text-align:right; margin:0; font-style: italic">Technical Specification</p>
<br />
<br />
<br />
<p style="font-size: 23px; text-align:right; margin:0; font-weight: bold">3rd Generation Partnership Project;</p>
<p style="font-size: 23px; text-align:right; margin:0; font-weight: bold">Technical Specification Group Radio Access Network;</p>
<p style="font-size: 23px; text-align:right; margin:0; font-weight: bold">NR;</p>
<p style="font-size: 23px; text-align:right; margin:0; font-weight: bold">Radio Resource Control (RRC) protocol specification</p>
<p style="font-size: 23px; text-align:right; margin:0; font-weight: bold">(Release 18)</p>
<br />
<br />
<br />
<hr />
<div style="display: flex;">
	<div style="flex:50%;"><img src="media/image1.png" height="84" width="119" /></div>
	<div style="flex:50%;"><img src="media/image2.png" height="95" width="159" /></div>
</div>
<div class="title-page-statement">
<p class="nospace">The present document has been developed within the 3rd Generation Partnership Project (3GPP <sup>TM</sup>) and may be further elaborated for the purposes of 3GPP.</p>
<p class="nospace">The present document has not been subject to any approval process by the 3GPP Organizational Partners and shall not be implemented.</p>
<p class="nospace">This Specification is provided for future development work within 3GPP only. The Organizational Partners accept no liability for any use of this Specification.</p>
<p class="nospace">Specifications and Reports for implementation of the 3GPP <sup >TM</sup> system should be obtained via the 3GPP Organizational Partners' Publications Offices.</p>
</div>
<div class="pagebreak"> </div>
<div class="title-page-address">
	<p class="nospace"><strong><em>3GPP</em></strong></p>
	<br />
	<p class="nospace">Postal address</p>
	<hr width="250px;">
	<br />
	<p class="nospace">3GPP support office address</p>
	<hr width="250px">
	<p class="nospace">650 Route des Lucioles - Sophia Antipolis</p>
	<p class="nospace">Valbonne - FRANCE</p>
	<p class="nospace">Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16</p>
	<br />
	<p class="nospace">Internet</p>
	<hr width="250px">
	<p class="nospace">http://www.3gpp.org</p>
</div>

<div style="text-align: center;">
	<p><strong><em>Copyright Notification</em></strong></p>
	<hr />
	<p class="nospace">No part may be reproduced except as authorized by written permission</p>
	<p class="nospace">The copyright and the foregoing restriction extend to reproduction in all media.</p>
	<br />
	<p class="nospace">© 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI,	TTA, TTC).</p>
	<p class="nospace">All rights reserved.</p>
</div>
<br />
<p class="nospace">UMTS™ is a Trade Mark of ETSI registered for the benefit of its members</p>
<p class="nospace">3GPP™ is a Trade Mark of ETSI registered for the benefit of its Members and of the 3GPP Organizational Partners<br />
<p class="nospace">LTE™ is a Trade Mark of ETSI registered for the benefit of its Members and of the 3GPP Organizational Partners</p>
<p class="nospace">GSM® and the GSM logo are registered and owned by the GSM Association </p>
<div class="pagebreak"> </div>
+10 −18
Original line number Diff line number Diff line
@@ -6,7 +6,9 @@ The main steps that will be taken during this exercise after the prerequisite st
  - Procedural text indentation
  - ASN.1 indentation and colorization
  - MSC signalling and block diagram rendering
2. In a manual step, you will copy the cover page and table of contents to the HTML file. This step will be automated in the future.
  - Cover page insertion (New as of May 2025)
  - Table of contents generation (New as of May 2025)
2. VOID (New as of May 2025).
3. Run `html_to_pdf.bat` to convert the HTML file to PDF.

## Prerequisites
@@ -62,7 +64,8 @@ This demonstration assumes the use of Microsoft Windows 10 or 11. As needed, oth
After following these steps, you should be left with at least the following directory structure. For brevity, only crucial files are listed.

**markdown-specification**
- 38331-i00.md
- 38331-i00.md (Updated as of May 2025)
- 38331-i00_cover_page.html (New as of May 2025)
- README.md
- *examples*
  - 38331-i00_cover_toc.html
@@ -73,6 +76,7 @@ After following these steps, you should be left with at least the following dire
- *scripts*
  - asn_render.lua
  - config.bat
  - cover_page.lua (New as of May 2025)
  - html_to_pdf.bat
  - indent_procedural.lua
  - md_to_html.bat
@@ -80,6 +84,7 @@ After following these steps, you should be left with at least the following dire
  - pandoc.exe
  - print_style_px.css
  - README.md
  - toc.lua (New as of May 2025)
  - weasyprint.exe

## Converting Markdown to HTML
@@ -89,29 +94,16 @@ The steps in this version of the instructions will require the use of the Window
1. Open a Windows Command Prompt
- In the Windows Start Menu, simply type "command", and it should be the first result.

2. Navigate to the directory containing the conversion scripts, replacing the example directory below with the one used in Step 4 of the Prerequisites.
> cd C:\\Users\\\<username\>\\\<git_directory>\markdown-specification\scripts
2. VOID

3. Edit config.bat to match your environment.
- OUTPUT_DIR - This can be the base repository directory or a new output directory can be created in the repository folder.
- INPUT_DIR - This shoudl be the base repostitory directory, the path ending in markdown-specification.
- Nothing else needs to be changed for now.
3. VOID

4. Enter the command. Running the command in the command prompt enables the viewing of any errors or warnings which may arise during the process.
> md_to_html.bat

- While running the script, there will be a few prompts asking to delete a directory. Verify that the directories are listed as expected. If they are, enter a capital "Y" and press enter.

5. Copy the cover page and table of contents to the HTML file.
- The process of inserting the cover page and generating and inserting the table of contents are manual processes, but will be automated in the future. Once the HTML version of the specification is generated through the execution of the steps explained previously, the example cover page and table of contents can be simply copied and pasted to the top of the HTML file. Do this prior to converting the HTML to PDF.
- **Note:** The cover page and table of contents is only provided for the main branch, before any changes have been applied.
- Navigate to the examples directory.
- Open 38331-i00_cover_toc.html
- Select all the contents and copy them to the clip board (e.g., ctrl+c).
- Navigate to the output directory.
- Open 38331-i00.html
- Delete the text between the first line and the line preceding "\<h1 id="foreword"\>Foreword\</h1\>".
  - Note that in Notepad++, this can be accomplished by clicking before the first line and holding ctrl+shift+B, clicking at the end of the line preceding the one described in the bullet above and holding ctrl+shift+B. Now the text is selected, and you can press the "del" key to delete the text, and then copy in the content of cover_toc_38331-i00.html.
5. VOID

## Converting HTML to PDF

+7 −3
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@ REM Licensed under tREM he BSD 3-Clause License
REM SPDX-License-IdentifREM ier: BSD-3-Clause

REM Output directory for processing scripts
set OUTPUT_DIR="C:\Users\<directories>\markdown-specification\output"
set OUTPUT_DIR="..\output"

REM Input directory containing specification document
set INPUT_DIR="C:\Users\<directories>\markdown-specification"
set INPUT_DIR=".."

REM * Path to pandoc executable
set PANDOC_PATH=pandoc.exe
@@ -26,7 +26,11 @@ set MD_PATH=%INPUT_DIR%\38331-i00.md
REM * Configuration for markdown to HTML
set HTML_TITLE="TS38.331 v18.0.0"
set HTML_PATH=%OUTPUT_DIR%\38331-i00.html
set CSS_PATH=print_style_px.css
set CSS_FILE=print_style_px.css
set CSS_PATH=%INPUT_DIR%\%CSS_FILE%

set COVER_PAGE_FILE=38331-i00_cover_page.html
set COVER_PAGE_PATH=%INPUT_DIR%\%COVER_PAGE_FILE%

REM * Configuration for HTML to PDF conversion
set PDF_PATH=%OUTPUT_DIR%\38331-i00.pdf
 No newline at end of file

scripts/cover_page.lua

0 → 100644
+27 −0
Original line number Diff line number Diff line
-- © 2025 Nokia
-- Licensed under the BSD 3-Clause License
-- SPDX-License-Identifier: BSD-3-Clause

local coverPagePath = nil

function Meta(meta)
    -- Get command line argument for the cover page path
    coverPagePath = meta.cover_page_path

end   

function Pandoc(doc)
      
    if coverPagePath ~= nil then
        -- Read cover page into memory
        local f = io.open(coverPagePath, "rb")
        local coverHTML = f:read "*a"
        f:close()
        
        -- Prepend cover page as raw HTML
        local coverHTMLBlock = pandoc.RawBlock("html", coverHTML)
        table.insert(doc.blocks, 1, coverHTMLBlock)
        return doc
    end

end
 No newline at end of file
Loading