mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-29 23:54:05 +08:00
Standardised export views with base layout, Reduced included export styles
Related to #2666
This commit is contained in:
parent
43b6633183
commit
95798a2eba
@ -1,16 +1,13 @@
|
|||||||
@import "variables";
|
@import "variables";
|
||||||
@import "mixins";
|
@import "mixins";
|
||||||
@import "spacing";
|
|
||||||
@import "html";
|
@import "html";
|
||||||
@import "text";
|
@import "text";
|
||||||
@import "layout";
|
@import "layout";
|
||||||
@import "blocks";
|
@import "blocks";
|
||||||
@import "tables";
|
@import "tables";
|
||||||
@import "header";
|
|
||||||
@import "lists";
|
@import "lists";
|
||||||
@import "pages";
|
@import "pages";
|
||||||
|
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
background-color: #FFF;
|
background-color: #FFF;
|
||||||
}
|
}
|
||||||
@ -40,4 +37,25 @@ pre:after {
|
|||||||
}
|
}
|
||||||
pre code {
|
pre code {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-break {
|
||||||
|
page-break-after: always;
|
||||||
|
}
|
||||||
|
@media screen {
|
||||||
|
.page-break {
|
||||||
|
border-top: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.contents ul li {
|
||||||
|
list-style: circle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-hint {
|
||||||
|
color: #888;
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
.chapter-hint + h1 {
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
@ -1,38 +1,8 @@
|
|||||||
<!doctype html>
|
@extends('export-layout')
|
||||||
<html lang="{{ config('app.lang') }}">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
||||||
<title>{{ $book->name }}</title>
|
|
||||||
|
|
||||||
@include('partials.export-styles', ['format' => $format])
|
@section('title', $book->name)
|
||||||
|
|
||||||
<style>
|
|
||||||
.page-break {
|
|
||||||
page-break-after: always;
|
|
||||||
}
|
|
||||||
.chapter-hint {
|
|
||||||
color: #888;
|
|
||||||
margin-top: 32px;
|
|
||||||
}
|
|
||||||
.chapter-hint + h1 {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
ul.contents ul li {
|
|
||||||
list-style: circle;
|
|
||||||
}
|
|
||||||
@media screen {
|
|
||||||
.page-break {
|
|
||||||
border-top: 1px solid #DDD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@yield('head')
|
|
||||||
@include('partials.export-custom-head')
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="page-content">
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
<h1 style="font-size: 4.8em">{{$book->name}}</h1>
|
<h1 style="font-size: 4.8em">{{$book->name}}</h1>
|
||||||
|
|
||||||
<p>{{ $book->description }}</p>
|
<p>{{ $book->description }}</p>
|
||||||
@ -73,8 +43,4 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endsection
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,30 +1,8 @@
|
|||||||
<!doctype html>
|
@extends('export-layout')
|
||||||
<html lang="{{ config('app.lang') }}">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
||||||
<title>{{ $chapter->name }}</title>
|
|
||||||
|
|
||||||
@include('partials.export-styles', ['format' => $format])
|
@section('title', $chapter->name)
|
||||||
|
|
||||||
<style>
|
|
||||||
.page-break {
|
|
||||||
page-break-after: always;
|
|
||||||
}
|
|
||||||
ul.contents ul li {
|
|
||||||
list-style: circle;
|
|
||||||
}
|
|
||||||
@media screen {
|
|
||||||
.page-break {
|
|
||||||
border-top: 1px solid #DDD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@include('partials.export-custom-head')
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div class="page-content">
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
<h1 style="font-size: 4.8em">{{$chapter->name}}</h1>
|
<h1 style="font-size: 4.8em">{{$chapter->name}}</h1>
|
||||||
|
|
||||||
<p>{{ $chapter->description }}</p>
|
<p>{{ $chapter->description }}</p>
|
||||||
@ -42,8 +20,4 @@
|
|||||||
<h1 id="page-{{$page->id}}">{{ $page->name }}</h1>
|
<h1 id="page-{{$page->id}}">{{ $page->name }}</h1>
|
||||||
{!! $page->html !!}
|
{!! $page->html !!}
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endsection
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
15
resources/views/export-layout.blade.php
Normal file
15
resources/views/export-layout.blade.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="{{ config('app.lang') }}">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
<title>@yield('title')</title>
|
||||||
|
|
||||||
|
@include('partials.export-styles', ['format' => $format])
|
||||||
|
@include('partials.export-custom-head')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="page-content">
|
||||||
|
@yield('content')
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,51 +1,13 @@
|
|||||||
<!doctype html>
|
@extends('export-layout')
|
||||||
<html lang="{{ config('app.lang') }}">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
||||||
<title>{{ $page->name }}</title>
|
|
||||||
|
|
||||||
@include('partials.export-styles', ['format' => $format])
|
@section('title', $page->name)
|
||||||
|
|
||||||
@if($format === 'pdf')
|
@section('content')
|
||||||
<style>
|
@include('pages.page-display')
|
||||||
body {
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
<hr>
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
max-width: 800px !important;
|
|
||||||
font-size: 0.8em;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
table td {
|
|
||||||
width: auto !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@include('partials.export-custom-head')
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="page-show">
|
|
||||||
<div class="page-content">
|
|
||||||
|
|
||||||
@include('pages.page-display')
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<div class="text-muted text-small">
|
|
||||||
@include('partials.entity-export-meta', ['entity' => $page])
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="text-muted text-small">
|
||||||
|
@include('partials.entity-export-meta', ['entity' => $page])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endsection
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -6,6 +6,27 @@
|
|||||||
|
|
||||||
@if ($format === 'pdf')
|
@if ($format === 'pdf')
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
/* PDF size adjustments */
|
||||||
|
body {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1, h2, h3, h4, h5, h6 {
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
max-width: 800px !important;
|
||||||
|
font-size: 0.8em;
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table td {
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Patches for CSS variable colors */
|
/* Patches for CSS variable colors */
|
||||||
a {
|
a {
|
||||||
color: {{ setting('app-color') }};
|
color: {{ setting('app-color') }};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user