Skip to content

Commit

Permalink
[useblocks#34] prefix css rules with ssp and add default wrap option …
Browse files Browse the repository at this point in the history
…to all needs
  • Loading branch information
kreuzberger committed Sep 19, 2022
1 parent 8c81ed4 commit bd7f3ba
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 5 deletions.
5 changes: 4 additions & 1 deletion demo/lists_tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ False True True
True True True
===== ===== ======

.. rst-class:: break_before, ssp-landscape, break_after

Giant Tables
^^^^^^^^^^^^

Expand All @@ -311,6 +313,7 @@ Giant Tables
| body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 | body row 1 | column 2 | column 3 |
+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+------------+------------+-----------+


List Tables
-----------

Expand Down Expand Up @@ -375,7 +378,7 @@ Tables with non-breakable text

.. list-table::
:widths: 10,80
:class: table-wrap
:class: ssp-table-wrap

* - True
- This text could be broken at all whitespaces occuring in the text
Expand Down
70 changes: 70 additions & 0 deletions demo/needs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"created": "2022-09-19T15:12:30.462819",
"current_version": "1.0",
"project": "Sphinx-SimplePDF-DEMO",
"versions": {
"1.0": {
"created": "2022-09-19T15:12:30.462811",
"filters": {},
"filters_amount": 0,
"needs": {
"REQ_021": {
"avatar": "",
"closed_at": "",
"completion": "",
"created_at": "",
"description": "The ``Sphinx-Needs Theme`` for PDF shall support also text even if imported. This_is_a_non_breakable_line_due_to_no_whitespaces_in_text_at_all_which_is_not_readable_without_breaking_it_working_if_you_can_read_THIS",
"docname": "sphinx_needs",
"duration": "",
"external_css": "external_link",
"external_url": null,
"full_title": "Sphinx-Needs Theme extension from import",
"has_dead_links": "",
"has_forbidden_dead_links": "",
"hidden": "",
"id": "REQ_021",
"id_complete": "REQ_021",
"id_parent": "REQ_021",
"id_prefix": "",
"is_external": false,
"is_modified": false,
"is_need": true,
"is_part": false,
"layout": "",
"links": [],
"max_amount": "",
"max_content_lines": "",
"modifications": 0,
"parent_need": null,
"parent_needs": [],
"parent_needs_back": [],
"parts": {},
"post_template": null,
"pre_template": null,
"query": "",
"section_name": "Another",
"sections": [
"Another"
],
"service": "",
"signature": "",
"specific": "",
"status": "done",
"style": null,
"tags": [
"sphinx",
"extension"
],
"template": null,
"title": "Sphinx-Needs Theme extension support with code examples from imported needs",
"type": "req",
"type_name": "Requirement",
"updated_at": "",
"url": "",
"user": ""
}
},
"needs_amount": 1
}
}
}
7 changes: 6 additions & 1 deletion demo/sphinx_needs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ This is the same table, but with datatables style. This normally adds a scrollba
.. needtable::
:filter: 'sphinx' in tags
:style: datatables
:class: table-wrap
:colwidths: 10,10,10,10,60
:columns: id, title, status, tags, content

Expand All @@ -59,6 +58,12 @@ Using ``plantuml`` to render image.
.. needflow::
:filter: 'sphinx' in tags

Sphinx-Needs needimport
=======================

.. needimport:: needs.json
:tags: imported
:collapse: True

CSV Table
---------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.needs_style_break {
page-break-before: always;
}
page-break-before: always;
}

table.need, table.NEEDS_DATATABLES, .needs_style_ssp-table-wrap {
table-layout: fixed;
td, th {
overflow-wrap: break-word;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
page-break-before: always;
}

@page landscape_page {
size: landscape;
}

@page portrait_page {
size: portrait;
}

.ssp-portrait {
page: portrait_page;

}
.ssp-landscape {
page: landscape_page;
}

@page {
padding-top: 1em;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ table.break {
page-break-before: always;
}

table.table-wrap {
table.ssp-table-wrap {
table-layout: fixed;
td, th {
overflow-wrap: break-word;
Expand Down

0 comments on commit bd7f3ba

Please sign in to comment.