',$(div).appendTo("body").click(function(){$("html").removeClass("nav-open"),nowuiDashboard.misc.navbar_menu_visible=0,setTimeout(function(){$toggle.removeClass("toggled"),$("#bodyClick").remove()},550)}),$("html").addClass("nav-open"),nowuiDashboard.misc.navbar_menu_visible=1)}),$(window).resize(function(){seq=seq2=0,0==$(".full-screen-map").length&&0==$(".bd-docs").length&&($navbar=$(".navbar"),isExpanded=$(".navbar").find('[data-toggle="collapse"]').attr("aria-expanded"),$navbar.hasClass("bg-white")&&991<$(window).width()?0==scrollElement.scrollTop()&&$navbar.removeClass("bg-white").addClass("navbar-transparent"):$navbar.hasClass("navbar-transparent")&&$(window).width()<991&&"false"!=isExpanded&&$navbar.addClass("bg-white").removeClass("navbar-transparent")),is_iPad&&$("body").removeClass("sidebar-mini")}),nowuiDashboard={misc:{navbar_menu_visible:0},showNotification:function(a,e){color="primary",$.notify({icon:"now-ui-icons ui-1_bell-53",message:"Welcome to Now Ui Dashboard - a beautiful freebie for every web developer."},{type:color,timer:8e3,placement:{from:a,align:e}})}};
2 | //# sourceMappingURL=_site_dashboard_free/assets/js/dashboard-free.js.map
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard.scss:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | =========================================================
4 | * Now UI Dashboard - v1.3.0
5 | =========================================================
6 |
7 | * Product Page: https://www.creative-tim.com/product/now-ui-dashboard
8 | * Copyright 2019 Creative Tim (http://www.creative-tim.com)
9 |
10 | * Designed by www.invisionapp.com Coded by www.creative-tim.com
11 |
12 | =========================================================
13 |
14 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15 |
16 | */
17 |
18 | @import 'now-ui-dashboard/variables';
19 | @import 'now-ui-dashboard/mixins';
20 |
21 | // Plugins CSS
22 | @import "now-ui-dashboard/plugins/plugin-animate-bootstrap-notify";
23 | @import "now-ui-dashboard/plugins/plugin-perfect-scrollbar";
24 |
25 | // Core CSS
26 | @import "now-ui-dashboard/buttons";
27 | @import "now-ui-dashboard/inputs";
28 | @import "now-ui-dashboard/typography";
29 | @import "now-ui-dashboard/misc";
30 | @import "now-ui-dashboard/checkboxes-radio";
31 |
32 | // components
33 | @import "now-ui-dashboard/navbar";
34 | @import "now-ui-dashboard/page-header";
35 | @import "now-ui-dashboard/dropdown";
36 | @import "now-ui-dashboard/alerts";
37 | @import "now-ui-dashboard/images";
38 | @import "now-ui-dashboard/nucleo-outline";
39 | @import "now-ui-dashboard/tables";
40 | @import "now-ui-dashboard/sidebar-and-main-panel";
41 | @import "now-ui-dashboard/footers";
42 | @import "now-ui-dashboard/fixed-plugin";
43 |
44 | // cards
45 | @import "now-ui-dashboard/cards";
46 | @import "now-ui-dashboard/cards/card-plain";
47 | @import "now-ui-dashboard/cards/card-chart";
48 | @import "now-ui-dashboard/cards/card-user";
49 | @import "now-ui-dashboard/cards/card-map";
50 |
51 | @import "now-ui-dashboard/responsive";
52 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_alerts.scss:
--------------------------------------------------------------------------------
1 | .alert{
2 | border: 0;
3 | border-radius: $border-radius-small;
4 | color: $white-color;
5 | padding-top: .9rem;
6 | padding-bottom: .9rem;
7 | position: relative;
8 |
9 | &.alert-success{
10 | background-color: lighten($success-color, 5%);
11 | }
12 |
13 | &.alert-danger{
14 | background-color: lighten($danger-color, 5%);
15 | }
16 |
17 | &.alert-warning{
18 | background-color: lighten($warning-color, 5%);
19 | }
20 |
21 | &.alert-info{
22 | background-color: lighten($info-color, 5%);
23 | }
24 |
25 | &.alert-primary{
26 | background-color: lighten($primary-color, 5%);
27 | }
28 |
29 |
30 | i.fa,
31 | i.now-ui-icons{
32 | font-size: 20px;
33 | }
34 |
35 | .close{
36 | color: $white-color !important;
37 | opacity: .9;
38 | text-shadow: none;
39 | line-height: 0;
40 | outline: 0;
41 | }
42 |
43 | span[data-notify="icon"]{
44 | font-size: 22px;
45 | display: block;
46 | left: 19px;
47 | position: absolute;
48 | top: 50%;
49 | margin-top: -11px;
50 | }
51 |
52 | button.close{
53 | position: absolute;
54 | right: 10px;
55 | top: 50%;
56 | margin-top: -13px;
57 | width: 25px;
58 | height: 25px;
59 | padding: 3px;
60 | }
61 |
62 | .close ~ span{
63 | display: block;
64 | max-width: 89%;
65 | }
66 |
67 | &.alert-with-icon{
68 | padding-left: 65px;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_cards.scss:
--------------------------------------------------------------------------------
1 | .card{
2 | border: 0;
3 | border-radius: $border-radius-small;
4 | display: inline-block;
5 | position: relative;
6 | width: 100%;
7 | margin-bottom: 20px;
8 | box-shadow: $box-shadow;
9 |
10 | [data-notify="container"].alert {
11 | min-width: auto;
12 | left: unset !important;
13 | right: unset !important;
14 | }
15 |
16 | .card-body{
17 | padding: 15px 15px 10px 15px;
18 |
19 | &.table-full-width{
20 | padding-left: 0;
21 | padding-right: 0;
22 | }
23 | }
24 |
25 | .card-header{
26 | &:not([data-background-color]){
27 | background-color: transparent;
28 | }
29 | padding: 15px 15px 0;
30 | border: 0;
31 |
32 | .card-title{
33 | margin-top: 10px;
34 | }
35 | }
36 |
37 | .map{
38 | border-radius: $border-radius-small;
39 |
40 | &.map-big{
41 | height: 400px;
42 | }
43 | }
44 |
45 | &[data-background-color="orange"]{
46 | background-color: $primary-color;
47 |
48 | .card-header{
49 | background-color: $primary-color;
50 | }
51 |
52 | .card-footer{
53 | .stats{
54 | color: $white-color;
55 | }
56 | }
57 | }
58 |
59 | &[data-background-color="red"]{
60 | background-color: $danger-color;
61 | }
62 |
63 | &[data-background-color="yellow"]{
64 | background-color: $warning-color;
65 | }
66 |
67 | &[data-background-color="blue"]{
68 | background-color: $info-color;
69 | }
70 |
71 | &[data-background-color="green"]{
72 | background-color: $success-color;
73 | }
74 |
75 | .image{
76 | overflow: hidden;
77 | height: 200px;
78 | position: relative;
79 | }
80 |
81 | .avatar{
82 | width: 30px;
83 | height: 30px;
84 | overflow: hidden;
85 | border-radius: 50%;
86 | margin-bottom: 15px;
87 | }
88 |
89 | label{
90 | font-size: $font-size-small;
91 | margin-bottom: 5px;
92 | color: $dark-gray;
93 | }
94 |
95 | .card-footer{
96 | background-color: transparent;
97 | border: 0;
98 |
99 |
100 | .stats{
101 | i{
102 | margin-right: 5px;
103 | position: relative;
104 | top: 2px;
105 | }
106 | }
107 |
108 | .btn{
109 | margin: 0;
110 | }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_checkboxes-radio.scss:
--------------------------------------------------------------------------------
1 | .form-check{
2 | margin-top: .5rem;
3 | }
4 |
5 | .form-check .form-check-label{
6 | display: inline-block;
7 | position: relative;
8 | cursor: pointer;
9 | padding-left: 35px;
10 | line-height: 26px;
11 | margin-bottom: 0;
12 | -webkit-transition: color 0.3s linear;
13 | -moz-transition: color 0.3s linear;
14 | -o-transition: color 0.3s linear;
15 | -ms-transition: color 0.3s linear;
16 | transition: color 0.3s linear;
17 | }
18 | .radio .form-check-sign{
19 | padding-left: 28px;
20 | }
21 |
22 | .form-check .form-check-sign::before,
23 | .form-check .form-check-sign::after{
24 | content: " ";
25 | display: inline-block;
26 | position: absolute;
27 | width: 26px;
28 | height: 26px;
29 | left: 0;
30 | cursor: pointer;
31 | border-radius: 3px;
32 | top: 0;
33 | background-color: transparent;
34 | border: 1px solid $light-gray;
35 | -webkit-transition: opacity 0.3s linear;
36 | -moz-transition: opacity 0.3s linear;
37 | -o-transition: opacity 0.3s linear;
38 | -ms-transition: opacity 0.3s linear;
39 | transition: opacity 0.3s linear;
40 | }
41 |
42 | .form-check .form-check-sign::after{
43 | font-family: 'Nucleo Outline';
44 | content: "\ea22";
45 | top: 0px;
46 | text-align: center;
47 | font-size: 14px;
48 | opacity: 0;
49 | color: $dark-background;
50 | border: 0;
51 | background-color: inherit;
52 | }
53 |
54 | .form-check.disabled .form-check-label,
55 | .form-check.disabled .form-check-label {
56 | color: $dark-gray;
57 | opacity: .5;
58 | cursor: not-allowed;
59 | }
60 |
61 | .form-check input[type="checkbox"],
62 | .radio input[type="radio"]{
63 | opacity: 0;
64 | position: absolute;
65 | visibility: hidden;
66 | }
67 | .form-check input[type="checkbox"]:checked + .form-check-sign::after{
68 | opacity: 1;
69 | }
70 |
71 | .form-control input[type="checkbox"]:disabled + .form-check-sign::before,
72 | .checkbox input[type="checkbox"]:disabled + .form-check-sign::after{
73 | cursor: not-allowed;
74 | }
75 |
76 | .form-check input[type="checkbox"]:disabled + .form-check-sign,
77 | .form-check input[type="radio"]:disabled + .form-check-sign{
78 | pointer-events: none;
79 | }
80 |
81 | .form-check-radio .form-check-sign::before,
82 | .form-check-radio .form-check-sign::after{
83 | content: " ";
84 | width: 20px;
85 | height: 20px;
86 | border-radius: 50%;
87 | border: 1px solid $light-gray;
88 | display: inline-block;
89 | position: absolute;
90 | left: 3px;
91 | top: 3px;
92 | padding: 1px;
93 | -webkit-transition: opacity 0.3s linear;
94 | -moz-transition: opacity 0.3s linear;
95 | -o-transition: opacity 0.3s linear;
96 | -ms-transition: opacity 0.3s linear;
97 | transition: opacity 0.3s linear;
98 | }
99 |
100 | .form-check-radio input[type="radio"] + .form-check-sign:after,
101 | .form-check-radio input[type="radio"] {
102 | opacity: 0;
103 | }
104 | .form-check-radio input[type="radio"]:checked + .form-check-sign::after {
105 | width: 4px;
106 | height: 4px;
107 | background-color: $dark-background;
108 | border-color: $dark-background;
109 | top: 11px;
110 | left: 11px;
111 | opacity: 1;
112 | }
113 |
114 | .form-check-radio input[type="radio"]:checked + .form-check-sign::after{
115 | opacity: 1;
116 | }
117 |
118 | .form-check-radio input[type="radio"]:disabled + .form-check-sign {
119 | color: $dark-gray;
120 | }
121 |
122 | .form-check-radio input[type="radio"]:disabled + .form-check-sign::before,
123 | .form-check-radio input[type="radio"]:disabled + .form-check-sign::after {
124 | color: $dark-gray;
125 | }
126 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_footers.scss:
--------------------------------------------------------------------------------
1 | .footer{
2 | padding: 24px 0;
3 |
4 | &.footer-default{
5 | background-color: #f2f2f2;
6 | }
7 |
8 | nav{
9 | display: inline-block;
10 | float: left;
11 | padding-left: 7px;
12 | }
13 |
14 | ul{
15 | margin-bottom: 0;
16 | padding: 0;
17 | list-style: none;
18 |
19 | li{
20 | display: inline-block;
21 |
22 | a{
23 | color: inherit;
24 | padding: $padding-base-vertical;
25 | font-size: $font-size-small;
26 | text-transform: uppercase;
27 | text-decoration: none;
28 |
29 | &:hover{
30 | text-decoration: none;
31 | }
32 | }
33 | }
34 | }
35 |
36 | &.fixed-bottom{
37 | width: calc(100% - 80px);
38 | margin-left: auto;
39 | }
40 |
41 | .copyright{
42 | font-size: $font-size-small;
43 | line-height: 1.8;
44 | }
45 |
46 | &:after{
47 | display: table;
48 | clear: both;
49 | content: " ";
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_images.scss:
--------------------------------------------------------------------------------
1 | img{
2 | max-width: 100%;
3 | border-radius: $border-radius-small;
4 | }
5 | .img-raised{
6 | box-shadow: $box-shadow-raised;
7 | }
8 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_misc.scss:
--------------------------------------------------------------------------------
1 | body{
2 | color: $black-color;
3 | font-size: $font-size-base;
4 | font-family: $sans-serif-family;
5 | -moz-osx-font-smoothing: grayscale;
6 | -webkit-font-smoothing: antialiased;
7 | }
8 |
9 | .main{
10 | position: relative;
11 | background: $white-color;
12 | }
13 | /* Animations */
14 | .nav-pills .nav-link,
15 | .navbar,
16 | .nav-tabs .nav-link,
17 | .sidebar .nav a,
18 | .sidebar .nav a i,
19 | .navbar-collapse .navbar-nav .nav-link,
20 | .animation-transition-general,
21 | .tag,
22 | .tag [data-role="remove"],
23 | .animation-transition-general{
24 | @include transition($general-transition-time, $transition-ease);
25 | }
26 |
27 | //transition for dropdown caret
28 | .dropdown-toggle:after,
29 | .bootstrap-switch-label:before,
30 | .caret{
31 | @include transition($fast-transition-time, $transition-ease);
32 | }
33 |
34 | .dropdown-toggle[aria-expanded="true"]:after,
35 | a[data-toggle="collapse"][aria-expanded="true"] .caret,
36 | .card-collapse .card a[data-toggle="collapse"][aria-expanded="true"] i,
37 | .card-collapse .card a[data-toggle="collapse"].expanded i{
38 | @include rotate-180();
39 | }
40 |
41 | .button-bar{
42 | display: block;
43 | position: relative;
44 | width: 22px;
45 | height: 1px;
46 | border-radius: 1px;
47 | background: $white-bg;
48 |
49 | & + .button-bar{
50 | margin-top: 7px;
51 | }
52 |
53 | &:nth-child(2){
54 | width: 17px;
55 | }
56 | }
57 |
58 | .caret{
59 | display: inline-block;
60 | width: 0;
61 | height: 0;
62 | margin-left: 2px;
63 | vertical-align: middle;
64 | border-top: 4px dashed;
65 | border-top: 4px solid\9;
66 | border-right: 4px solid transparent;
67 | border-left: 4px solid transparent;
68 | }
69 |
70 | .pull-left{
71 | float: left;
72 | }
73 | .pull-right{
74 | float: right;
75 | }
76 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_mixins.scss:
--------------------------------------------------------------------------------
1 | //Components
2 | @import "mixins/buttons";
3 | @import "mixins/vendor-prefixes";
4 | @import "mixins/inputs";
5 | @import "mixins/page-header";
6 | @import "mixins/dropdown";
7 | @import "mixins/sidebar";
8 | @import "mixins/cards";
9 | @import "mixins/transparency";
10 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_page-header.scss:
--------------------------------------------------------------------------------
1 | .page-header{
2 | min-height: 100vh;
3 | max-height: 999px;
4 | padding: 0;
5 | color: $white-color;
6 | position: relative;
7 |
8 | .page-header-image{
9 | position: absolute;
10 | background-size: cover;
11 | background-position: center center;
12 | width: 100%;
13 | height: 100%;
14 | z-index: -1;
15 | }
16 |
17 | .content-center{
18 | position: absolute;
19 | top: 50%;
20 | left: 50%;
21 | z-index: 2;
22 | -ms-transform: translate(-50%, -50%);
23 | -webkit-transform: translate(-50%, -50%);
24 | transform: translate(-50%, -50%);
25 | text-align: center;
26 | color: #FFFFFF;
27 | padding: 0 15px;
28 | width: 100%;
29 | max-width: 880px;
30 |
31 | }
32 |
33 | footer{
34 | position: absolute;
35 | bottom: 0;
36 | width: 100%;
37 | }
38 |
39 | .container{
40 | height: 100%;
41 | z-index: 1;
42 | }
43 |
44 | .category,
45 | .description{
46 | color: $opacity-8;
47 | }
48 |
49 | &.page-header-small{
50 | min-height: 60vh;
51 | max-height: 440px;
52 | }
53 |
54 | &.page-header-mini{
55 | min-height: 40vh;
56 | max-height: 340px;
57 | }
58 |
59 | .title{
60 | margin-bottom: 15px;
61 | }
62 | .title + h4{
63 | margin-top: 10px;
64 | }
65 |
66 | &:after,
67 | &:before{
68 | position: absolute;
69 | z-index: 0;
70 | width: 100%;
71 | height: 100%;
72 | display: block;
73 | left: 0;
74 | top: 0;
75 | content: "";
76 | }
77 |
78 | &:before{
79 | background-color: rgba(0,0,0,.3);
80 | }
81 |
82 | &[filter-color="orange"]{
83 | @include linear-gradient(rgba($black-color,.20), rgba(224, 23, 3, 0.6));
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_tables.scss:
--------------------------------------------------------------------------------
1 | .table{
2 |
3 | .img-wrapper{
4 | width: 40px;
5 | height: 40px;
6 | border-radius: 50%;
7 | overflow: hidden;
8 | margin: 0 auto;
9 | }
10 |
11 | .img-row{
12 | max-width: 60px;
13 | width: 60px;
14 | }
15 |
16 | .form-check{
17 | margin: 0;
18 |
19 | & label .form-check-sign::before,
20 | & label .form-check-sign::after{
21 | top: -17px;
22 | left: 4px;
23 | }
24 | }
25 |
26 | .btn{
27 | margin: 0;
28 | }
29 |
30 | small,.small{
31 | font-weight: 300;
32 | }
33 |
34 | .card-tasks .card-body &{
35 | margin-bottom: 0;
36 |
37 | > thead > tr > th,
38 | > tbody > tr > th,
39 | > tfoot > tr > th,
40 | > thead > tr > td,
41 | > tbody > tr > td,
42 | > tfoot > tr > td{
43 | padding-top: 0;
44 | padding-bottom: 0;
45 | }
46 | }
47 |
48 | > thead > tr > th{
49 | border-bottom-width: 1px;
50 | font-size: 1.45em;
51 | font-weight: $font-weight-light;
52 | border: 0;
53 | }
54 |
55 | .radio,
56 | .checkbox{
57 | margin-top: 0;
58 | margin-bottom: 0;
59 | padding: 0;
60 | width: 15px;
61 |
62 | .icons{
63 | position: relative;
64 | }
65 |
66 | label{
67 | &:after,
68 | &:before{
69 | top: -17px;
70 | left: -3px;
71 | }
72 | }
73 | }
74 | > thead > tr > th,
75 | > tbody > tr > th,
76 | > tfoot > tr > th,
77 | > thead > tr > td,
78 | > tbody > tr > td,
79 | > tfoot > tr > td{
80 | padding: 12px 7px;
81 | vertical-align: middle;
82 | }
83 |
84 | .th-description{
85 | max-width: 150px;
86 | }
87 | .td-price{
88 | font-size: 26px;
89 | font-weight: $font-weight-light;
90 | margin-top: 5px;
91 | position: relative;
92 | top: 4px;
93 | text-align: right;
94 | }
95 | .td-total{
96 | font-weight: $font-weight-bold;
97 | font-size: $font-size-h5;
98 | padding-top: 20px;
99 | text-align: right;
100 | }
101 |
102 | .td-actions .btn{
103 | margin: 0px;
104 | }
105 |
106 | > tbody > tr{
107 | position: relative;
108 | }
109 | }
110 |
111 | .table-shopping{
112 | > thead > tr > th{
113 | font-size: $font-size-h6;
114 | text-transform: uppercase;
115 | }
116 | > tbody > tr > td{
117 | font-size: $font-paragraph;
118 |
119 | b{
120 | display: block;
121 | margin-bottom: 5px;
122 | }
123 | }
124 | .td-name{
125 | font-weight: $font-weight-normal;
126 | font-size: 1.5em;
127 | small{
128 | color: $dark-gray;
129 | font-size: 0.75em;
130 | font-weight: $font-weight-light;
131 | }
132 | }
133 | .td-number{
134 | font-weight: $font-weight-light;
135 | font-size: $font-size-h4;
136 | }
137 | .td-name{
138 | min-width: 200px;
139 | }
140 | .td-number{
141 | text-align: right;
142 | min-width: 170px;
143 |
144 | small{
145 | margin-right: 3px;
146 | }
147 | }
148 |
149 | .img-container{
150 | width: 120px;
151 | max-height: 160px;
152 | overflow: hidden;
153 | display: block;
154 |
155 | img{
156 | width: 100%;
157 | }
158 | }
159 | }
160 |
161 | .table-responsive{
162 | overflow: auto;
163 | padding-bottom: 10px;
164 | }
165 |
166 | #tables .table-responsive{
167 | margin-bottom: 30px;
168 | }
169 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/_typography.scss:
--------------------------------------------------------------------------------
1 | button,
2 | input,
3 | optgroup,
4 | select,
5 | textarea{
6 | font-family: $sans-serif-family;
7 | }
8 | h1,h2,h3,h4,h5,h6{
9 | font-weight: $font-weight-normal;
10 | }
11 |
12 | a{
13 | color: $primary-color;
14 | &:hover,
15 | &:focus{
16 | color: $primary-color;
17 | }
18 | }
19 | h1, .h1 {
20 | font-size: $font-size-h1;
21 | line-height: 1.15;
22 | margin-bottom: $margin-base-vertical * 2;
23 |
24 | small{
25 | font-weight: $font-weight-bold;
26 | text-transform: uppercase;
27 | opacity: .8;
28 | }
29 | }
30 | h2, .h2{
31 | font-size: $font-size-h2;
32 | margin-bottom: $margin-base-vertical * 2;
33 | }
34 | h3, .h3{
35 | font-size: $font-size-h3;
36 | margin-bottom: $margin-base-vertical * 2;
37 | line-height: 1.4em;
38 | }
39 | h4, .h4{
40 | font-size: $font-size-h4;
41 | line-height: 1.45em;
42 | margin-top: $margin-base-vertical * 2;
43 | margin-bottom: $margin-base-vertical;
44 |
45 | & + .category,
46 | &.title + .category{
47 | margin-top: -10px;
48 | }
49 | }
50 | h5, .h5 {
51 | font-size: $font-size-h5;
52 | line-height: 1.4em;
53 | margin-bottom: 15px;
54 | }
55 | h6, .h6{
56 | font-size: $font-size-h6;
57 | font-weight: $font-weight-bold;
58 | text-transform: uppercase;
59 | }
60 | p{
61 | &.description{
62 | font-size: 1.14em;
63 | }
64 | }
65 |
66 | // i.fa{
67 | // font-size: 18px;
68 | // position: relative;
69 | // top: 1px;
70 | // }
71 |
72 | .title{
73 | font-weight: $font-weight-bold;
74 |
75 | &.title-up{
76 | text-transform: uppercase;
77 |
78 | a{
79 | color: $black-color;
80 | text-decoration: none;
81 | }
82 | }
83 | & + .category{
84 | margin-top: -10px;
85 | }
86 | }
87 |
88 | .description,
89 | .card-description,
90 | .footer-big p,
91 | .card .footer .stats{
92 | color: $dark-gray;
93 | font-weight: $font-weight-light;
94 | }
95 | .category,
96 | .card-category{
97 | text-transform: capitalize;
98 | font-weight: $font-weight-normal;
99 | color: $dark-gray;
100 | font-size: $font-size-mini;
101 | }
102 |
103 | .card-category{
104 | font-size: $font-size-h6;
105 | }
106 |
107 | .text-primary,
108 | a.text-primary:focus, a.text-primary:hover {
109 | color: $brand-primary !important;
110 | }
111 | .text-info,
112 | a.text-info:focus, a.text-info:hover {
113 | color: $brand-info !important;
114 | }
115 | .text-success,
116 | a.text-success:focus, a.text-success:hover {
117 | color: $brand-success !important;
118 | }
119 | .text-warning,
120 | a.text-warning:focus, a.text-warning:hover {
121 | color: $brand-warning !important;
122 | }
123 | .text-danger,
124 | a.text-danger:focus, a.text-danger:hover {
125 | color: $brand-danger !important;
126 | }
127 |
128 | .text-gray,
129 | a.text-gray:focus, a.text-gray:hover{
130 | color: $light-gray !important;
131 | }
132 |
133 |
134 | .blockquote{
135 | border-left: none;
136 | border: 1px solid $default-color;
137 | padding: 20px;
138 | font-size: $font-size-blockquote;
139 | line-height: 1.8;
140 |
141 | small{
142 | color: $default-color;
143 | font-size: $font-size-small;
144 | text-transform: uppercase;
145 | }
146 |
147 | &.blockquote-primary{
148 | border-color: $primary-color;
149 | color: $primary-color;
150 |
151 | small{
152 | color: $primary-color;
153 | }
154 | }
155 |
156 | &.blockquote-danger{
157 | border-color: $danger-color;
158 | color: $danger-color;
159 |
160 | small{
161 | color: $danger-color;
162 | }
163 | }
164 |
165 | &.blockquote-white{
166 | border-color: $opacity-8;
167 | color: $white-color;
168 |
169 | small{
170 | color: $opacity-8;
171 | }
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/cards/_card-chart.scss:
--------------------------------------------------------------------------------
1 | .card-chart {
2 | .card-header{
3 | .card-title{
4 | margin-top: 10px;
5 | margin-bottom: 0;
6 | }
7 | .card-category{
8 | margin-bottom: 5px;
9 | }
10 | }
11 |
12 | .table{
13 | margin-bottom: 0;
14 |
15 | td{
16 | border-top: none;
17 | border-bottom: 1px solid #e9ecef;
18 | }
19 | }
20 |
21 | .card-progress {
22 | margin-top: 30px;
23 | }
24 |
25 | .chart-area {
26 | height: 190px;
27 | width: calc(100% + 30px);
28 | margin-left: -15px;
29 | margin-right: -15px;
30 | }
31 | .card-footer {
32 | margin-top: 15px;
33 |
34 | .stats{
35 | color: $dark-gray;
36 | }
37 | }
38 |
39 | .dropdown{
40 | position: absolute;
41 | right: 20px;
42 | top: 20px;
43 |
44 | .btn{
45 | margin: 0;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/cards/_card-map.scss:
--------------------------------------------------------------------------------
1 | .map{
2 | height: 500px;
3 | }
4 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/cards/_card-plain.scss:
--------------------------------------------------------------------------------
1 |
2 | .card-plain{
3 | background: transparent;
4 | box-shadow: none;
5 |
6 | .card-header,
7 | .card-footer{
8 | margin-left: 0;
9 | margin-right: 0;
10 | background-color: transparent;
11 | }
12 |
13 | &:not(.card-subcategories).card-body{
14 | padding-left: 0;
15 | padding-right: 0;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/cards/_card-user.scss:
--------------------------------------------------------------------------------
1 | .card-user{
2 | .image{
3 | height: 120px;
4 | }
5 |
6 | .author{
7 | text-align: center;
8 | text-transform: none;
9 | margin-top: -77px;
10 |
11 | a + p.description{
12 | margin-top: -7px;
13 | }
14 | }
15 |
16 | .avatar{
17 | width: 124px;
18 | height: 124px;
19 | border: 1px solid $white-color;
20 | position: relative;
21 | }
22 |
23 | .card-body{
24 | min-height: 240px;
25 | }
26 |
27 | hr{
28 | margin: 5px 15px;
29 | }
30 |
31 | .button-container{
32 | margin-bottom: 6px;
33 | text-align: center;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/mixins/_cards.scss:
--------------------------------------------------------------------------------
1 | @mixin icon-color($color) {
2 | box-shadow: 0px 9px 30px -6px $color;
3 | color: $color;
4 | }
5 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/mixins/_dropdown.scss:
--------------------------------------------------------------------------------
1 | @mixin dropdown-colors($brand-color, $dropdown-header-color, $dropdown-color, $background-color ) {
2 | background-color: $brand-color;
3 |
4 | &:before{
5 | color: $brand-color;
6 | }
7 |
8 | .dropdown-header:not([href]):not([tabindex]){
9 | color: $dropdown-header-color;
10 | }
11 |
12 | .dropdown-item{
13 | color: $dropdown-color;
14 |
15 | &:hover,
16 | &:focus{
17 | background-color: $background-color;
18 | }
19 | }
20 |
21 | .dropdown-divider{
22 | background-color: $background-color;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/mixins/_page-header.scss:
--------------------------------------------------------------------------------
1 | @mixin linear-gradient($color1, $color2){
2 | background: $color1; /* For browsers that do not support gradients */
3 | background: -webkit-linear-gradient(90deg, $color1 , $color2); /* For Safari 5.1 to 6.0 */
4 | background: -o-linear-gradient(90deg, $color1, $color2); /* For Opera 11.1 to 12.0 */
5 | background: -moz-linear-gradient(90deg, $color1, $color2); /* For Firefox 3.6 to 15 */
6 | background: linear-gradient(0deg, $color1 , $color2); /* Standard syntax */
7 | }
8 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/mixins/_sidebar.scss:
--------------------------------------------------------------------------------
1 | @mixin sidebar() {
2 | .sidebar,
3 | .bootstrap-navbar {
4 | position: fixed;
5 | display: block;
6 | top: 0;
7 | height: 100%;
8 | width: 260px;
9 | right: auto;
10 | left: 0;
11 | z-index: 1032;
12 | visibility: visible;
13 | overflow-y: visible;
14 | padding: 0;
15 | @include transition (0.50s, cubic-bezier(0.685, 0.0473, 0.346, 1));
16 |
17 | @include transform-translate-x(-260px);
18 | }
19 |
20 | .bar1,
21 | .bar2,
22 | .bar3 {
23 | outline: 1px solid transparent;
24 | }
25 | .bar1 {
26 | top: 0px;
27 | @include bar-animation($topbar-back);
28 | }
29 | .bar2 {
30 | opacity: 1;
31 | }
32 | .bar3 {
33 | bottom: 0px;
34 | @include bar-animation($bottombar-back);
35 | }
36 | .toggled .bar1 {
37 | top: 6px;
38 | @include bar-animation($topbar-x);
39 | }
40 | .toggled .bar2 {
41 | opacity: 0;
42 | }
43 | .toggled .bar3 {
44 | bottom: 6px;
45 | @include bar-animation($bottombar-x);
46 | }
47 |
48 | @include topbar-x-rotation();
49 | @include topbar-back-rotation();
50 | @include bottombar-x-rotation();
51 | @include bottombar-back-rotation();
52 |
53 | @-webkit-keyframes fadeIn {
54 | 0% {opacity: 0;}
55 | 100% {opacity: 1;}
56 | }
57 | @-moz-keyframes fadeIn {
58 | 0% {opacity: 0;}
59 | 100% {opacity: 1;}
60 | }
61 | @keyframes fadeIn {
62 | 0% {opacity: 0;}
63 | 100% {opacity: 1;}
64 | }
65 |
66 | .navbar-toggler-bar{
67 | display: block;
68 | position: relative;
69 | width: 22px;
70 | height: 1px;
71 | border-radius: 1px;
72 | background: $white-bg;
73 |
74 | & + .navbar-toggler-bar{
75 | margin-top: 7px;
76 | }
77 |
78 | & + .navbar-toggler-bar.navbar-kebab{
79 | margin-top: 3px !important;
80 | }
81 |
82 | &.bar2{
83 | width: 17px;
84 | transition: width .2s linear;
85 | }
86 | }
87 |
88 | .main-panel{
89 | width: 100%;
90 | }
91 |
92 | .navbar-toggle .navbar-toggler,
93 | .navbar-toggle{
94 | display: block !important;
95 | }
96 |
97 | .navbar{
98 | & .toggled .navbar-toggler-bar{
99 | width: 24px;
100 |
101 | & + .navbar-toggler-bar{
102 | margin-top: 5px;
103 | }
104 | }
105 | }
106 |
107 | .nav-open{
108 | .main-panel{
109 | right: 0;
110 | @include transform-translate-x(260px);
111 | }
112 |
113 | .sidebar{
114 | @include transform-translate-x(0px);
115 | box-shadow: $sidebar-box-shadow;
116 | }
117 |
118 | body{
119 | position: relative;
120 | overflow-x: hidden;
121 | }
122 |
123 | .menu-on-right{
124 | .main-panel{
125 | @include transform-translate-x(-260px);
126 | }
127 |
128 | .navbar-collapse,
129 | .sidebar{
130 | @include transform-translate-x(0px);
131 | }
132 |
133 | .navbar-translate{
134 | @include transform-translate-x(-300px);
135 | }
136 |
137 | #bodyClick{
138 | right: 260px;
139 | left: auto;
140 | }
141 | }
142 | }
143 |
144 | .menu-on-right{
145 | .sidebar{
146 | left: auto;
147 | right:0;
148 | @include transform-translate-x(260px);
149 | }
150 | }
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/mixins/_transparency.scss:
--------------------------------------------------------------------------------
1 | // Opacity
2 |
3 | @mixin opacity($opacity) {
4 | opacity: $opacity;
5 | // IE8 filter
6 | $opacity-ie: ($opacity * 100);
7 | filter: #{alpha(opacity=$opacity-ie)};
8 | }
9 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/assets/scss/now-ui-dashboard/plugins/_plugin-perfect-scrollbar.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Container style
3 | */
4 | .ps {
5 | overflow: hidden !important;
6 | overflow-anchor: none;
7 | -ms-overflow-style: none;
8 | touch-action: auto;
9 | -ms-touch-action: auto;
10 | }
11 |
12 | /*
13 | * Scrollbar rail styles
14 | */
15 | .ps__rail-x {
16 | display: none;
17 | opacity: 0;
18 | transition: background-color .2s linear, opacity .2s linear;
19 | -webkit-transition: background-color .2s linear, opacity .2s linear;
20 | height: 15px;
21 | /* there must be 'bottom' or 'top' for ps__rail-x */
22 | bottom: 0px;
23 | /* please don't change 'position' */
24 | position: absolute;
25 | }
26 |
27 | .ps__rail-y {
28 | display: none;
29 | opacity: 0;
30 | transition: background-color .2s linear, opacity .2s linear;
31 | -webkit-transition: background-color .2s linear, opacity .2s linear;
32 | width: 15px;
33 | /* there must be 'right' or 'left' for ps__rail-y */
34 | right: 0;
35 | /* please don't change 'position' */
36 | position: absolute;
37 | }
38 |
39 | .ps--active-x > .ps__rail-x,
40 | .ps--active-y > .ps__rail-y {
41 | display: block;
42 | background-color: transparent;
43 | }
44 |
45 | .ps:hover > .ps__rail-x,
46 | .ps:hover > .ps__rail-y,
47 | .ps--focus > .ps__rail-x,
48 | .ps--focus > .ps__rail-y,
49 | .ps--scrolling-x > .ps__rail-x,
50 | .ps--scrolling-y > .ps__rail-y {
51 | opacity: 0.6;
52 | }
53 |
54 | .ps .ps__rail-x:hover,
55 | .ps .ps__rail-y:hover,
56 | .ps .ps__rail-x:focus,
57 | .ps .ps__rail-y:focus,
58 | .ps .ps__rail-x.ps--clicking,
59 | .ps .ps__rail-y.ps--clicking {
60 | background-color: #eee;
61 | opacity: 0.9;
62 | }
63 |
64 | /*
65 | * Scrollbar thumb styles
66 | */
67 | .ps__thumb-x {
68 | background-color: #aaa;
69 | border-radius: 6px;
70 | transition: background-color .2s linear, height .2s ease-in-out;
71 | -webkit-transition: background-color .2s linear, height .2s ease-in-out;
72 | height: 6px;
73 | /* there must be 'bottom' for ps__thumb-x */
74 | bottom: 2px;
75 | /* please don't change 'position' */
76 | position: absolute;
77 | }
78 |
79 | .ps__thumb-y {
80 | background-color: #aaa;
81 | border-radius: 6px;
82 | transition: background-color .2s linear, width .2s ease-in-out;
83 | -webkit-transition: background-color .2s linear, width .2s ease-in-out;
84 | width: 6px;
85 | /* there must be 'right' for ps__thumb-y */
86 | right: 2px;
87 | /* please don't change 'position' */
88 | position: absolute;
89 | }
90 |
91 | .ps__rail-x:hover > .ps__thumb-x,
92 | .ps__rail-x:focus > .ps__thumb-x,
93 | .ps__rail-x.ps--clicking .ps__thumb-x {
94 | background-color: #999;
95 | height: 11px;
96 | }
97 |
98 | .ps__rail-y:hover > .ps__thumb-y,
99 | .ps__rail-y:focus > .ps__thumb-y,
100 | .ps__rail-y.ps--clicking .ps__thumb-y {
101 | background-color: #999;
102 | width: 11px;
103 | }
104 |
105 | /* MS supports */
106 | @supports (-ms-overflow-style: none) {
107 | .ps {
108 | overflow: auto !important;
109 | }
110 | }
111 |
112 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
113 | .ps {
114 | overflow: auto !important;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/app/static/favicon.ico
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/static/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 | https://flask-boilerplate.appseed.us
11 | 1
12 | monthly
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/includes/footer.html:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/includes/navigation.html:
--------------------------------------------------------------------------------
1 |
2 |
66 |
67 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/includes/scripts.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
11 |
13 |
15 |
16 |
17 |
18 |
20 |
21 |
23 |
25 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/includes/sidebar.html:
--------------------------------------------------------------------------------
1 |
2 |
70 |
71 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Now UI Dashboard by Creative Tim
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | {% include 'includes/sidebar.html' %}
28 |
29 |
30 |
31 | {% include 'includes/navigation.html' %}
32 |
33 | {{ content | safe }}
34 |
35 | {% include 'includes/footer.html' %}
36 |
37 |
38 |
39 |
40 | {% include 'includes/scripts.html' %}
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/pages/login.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
84 |
85 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/templates/pages/register.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
116 |
117 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/app/util.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | Flask Boilerplate
4 | Author: AppSeed.us - App Generator
5 | """
6 |
7 | from flask import json, url_for, jsonify, render_template
8 | from jinja2 import TemplateNotFound
9 | from app import app
10 |
11 | from . models import User
12 | from app import app,db,bc,mail
13 | from . common import *
14 | from sqlalchemy import desc,or_
15 | import hashlib
16 | from flask_mail import Message
17 | import re
18 | from flask import render_template
19 |
20 | import os, datetime, time, random
21 |
22 | # build a Json response
23 | def response( data ):
24 | return app.response_class( response=json.dumps(data),
25 | status=200,
26 | mimetype='application/json' )
27 |
28 | def g_db_commit( ):
29 |
30 | db.session.commit( );
31 |
32 | def g_db_add( obj ):
33 |
34 | if obj:
35 | db.session.add ( obj )
36 |
37 | def g_db_del( obj ):
38 |
39 | if obj:
40 | db.session.delete ( obj )
41 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/config.yml:
--------------------------------------------------------------------------------
1 | language: python
2 | requirement: true
3 | title: flask application example
4 | type: Flask
5 | version: 3.5
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 | services:
3 | appseed-app:
4 | restart: always
5 | env_file: .env
6 | build: .
7 | ports:
8 | - "5005:5005"
9 | networks:
10 | - db_network
11 | - web_network
12 | nginx:
13 | restart: always
14 | image: "nginx:latest"
15 | ports:
16 | - "85:85"
17 | volumes:
18 | - ./nginx:/etc/nginx/conf.d
19 | networks:
20 | - web_network
21 | depends_on:
22 | - appseed-app
23 | networks:
24 | db_network:
25 | driver: bridge
26 | web_network:
27 | driver: bridge
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/gunicorn-cfg.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | License: Commercial
4 | Copyright (c) 2019 - present AppSeed.us
5 | """
6 |
7 | bind = '0.0.0.0:5005'
8 | workers = 1
9 | accesslog = '-'
10 | loglevel = 'debug'
11 | capture_output = True
12 | enable_stdio_inheritance = True
13 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/nginx/appseed-app.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 85;
3 |
4 | location / {
5 | proxy_pass http://localhost:5005/;
6 | proxy_set_header Host $host;
7 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/requirements.txt:
--------------------------------------------------------------------------------
1 | flask
2 | flask_login
3 | flask_migrate
4 | flask_wtf
5 | flask_sqlalchemy
6 | flask_bcrypt
7 | email_validator
8 | gunicorn
9 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/run.py:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 | """
3 | License: MIT
4 | Copyright (c) 2019 - present AppSeed.us
5 | """
6 | from werkzeug.middleware.proxy_fix import ProxyFix
7 |
8 | from app import app, db
9 | from os import getenv
10 | from werkzeug.middleware.dispatcher import DispatcherMiddleware
11 | from werkzeug.serving import run_simple
12 |
13 | #
14 | def _root_app(_, resp):
15 | resp(b'404 Not Found', [('Content-Type', 'text/plain')])
16 | return [b'Apache Airflow is not at this location']
17 | #
18 | # application = DispatcherMiddleware(
19 | # _root_app , { "/foo": app}
20 | # )
21 | app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
22 | # app.wsgi_app = DispatcherMiddleware(simple, {'/abc/123': app.wsgi_app})
23 |
24 |
25 | if __name__ == "__main__":
26 | app.run(port=5001)
27 | # run_simple(
28 | # "0.0.0.0",
29 | # int("5001"),
30 | # application,
31 | # use_debugger=False,
32 | # threaded=True,
33 | # )
34 | #
35 | # from flask import Flask
36 | #
37 | # from werkzeug.middleware.dispatcher import DispatcherMiddleware
38 | # from werkzeug.serving import run_simple
39 | # from werkzeug.contrib.fixers import ProxyFix
40 | # app = Flask(__name__)
41 | #
42 | # def _root_app(_, resp):
43 | # resp(b'404 Not Found', [('Content-Type', 'text/plain')])
44 | # return [b'Apache Airflow is not at this location']
45 | #
46 | # application = DispatcherMiddleware(
47 | # _root_app , { "/foo": app}
48 | # )
49 | # app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_port=1, x_prefix=1)
50 | #
51 | # @app.route('/')
52 | # def hello_world():
53 | # return 'Hello, World!'
54 |
55 |
56 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/runtime.txt:
--------------------------------------------------------------------------------
1 | python-3.7.2
2 |
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro-low.png
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro.gif
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-intro.png
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-main.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-main.jpg
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-notif.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-notif.jpg
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-register.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/0-python-dashboard/screenshots/flask-now-ui-dashboard-register.jpg
--------------------------------------------------------------------------------
/doc/publish_example/0-python-dashboard/uwsgi.ini:
--------------------------------------------------------------------------------
1 | [uwsgi]
2 | mount = /foo=run.py
3 | manage-script-name = true
4 |
5 | # also stuff which is not relevant for this, but included for completeness sake:
6 | module = run
7 | callable = app
8 | socket = /tmp/uwsgi.sock
9 |
--------------------------------------------------------------------------------
/doc/publish_example/1-just-csv/config.yml:
--------------------------------------------------------------------------------
1 | language: Data
2 | title: simple csv example
3 | type: csv
--------------------------------------------------------------------------------
/doc/publish_example/1-just-csv/test.csv:
--------------------------------------------------------------------------------
1 | x,y,z
2 | 1,2,3
3 | 2,3,4
4 | 3,4,5
5 | 4,5,6
6 | 5,6,7
7 | 6,7,8
8 | 7,8,9
9 | 8,9,10
10 | 9,10,11
11 | 10,11,12
12 | 11,12,13
13 | 12,13,14
14 | 13,14,15
15 | 14,15,16
16 | 15,16,17
17 | 16,17,18
18 | 17,18,19
19 | 18,19,20
20 | 19,20,21
21 | 20,21,22
22 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/.Rbuildignore:
--------------------------------------------------------------------------------
1 | ^.*\.Rproj$
2 | ^\.Rproj\.user$
3 | ^data-raw$
4 | dev_history.R
5 | ^dev$
6 | $run_dev.*
7 | ^README\.Rmd$
8 | ^CODE_OF_CONDUCT\.md$
9 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/.gitignore:
--------------------------------------------------------------------------------
1 | .Rproj.user
2 | .Rhistory
3 | .RData
4 | .Ruserdata
5 | inst/doc
6 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, we pledge to respect all people who
4 | contribute through reporting issues, posting feature requests, updating documentation,
5 | submitting pull requests or patches, and other activities.
6 |
7 | We are committed to making participation in this project a harassment-free experience for
8 | everyone, regardless of level of experience, gender, gender identity and expression,
9 | sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
10 |
11 | Examples of unacceptable behavior by participants include the use of sexual language or
12 | imagery, derogatory comments or personal attacks, trolling, public or private harassment,
13 | insults, or other unprofessional conduct.
14 |
15 | Project maintainers have the right and responsibility to remove, edit, or reject comments,
16 | commits, code, wiki edits, issues, and other contributions that are not aligned to this
17 | Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
18 | from the project team.
19 |
20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
21 | opening an issue or contacting one or more of the project maintainers.
22 |
23 | This Code of Conduct is adapted from the Contributor Covenant
24 | (https://www.contributor-covenant.org), version 1.0.0, available at
25 | https://contributor-covenant.org/version/1/0/0/.
26 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/DESCRIPTION:
--------------------------------------------------------------------------------
1 | Package: golemexample
2 | Title: Golem Example
3 | Version: 0.0.0.9000
4 | Authors@R: person('Colin', 'Fay', email = 'contact@colinfay.me', role = c('cre', 'aut'))
5 | Description: A Package to show the basics of a golem.
6 | License: What license is it under?
7 | Encoding: UTF-8
8 | LazyData: true
9 | Imports:
10 | shiny,
11 | golem,
12 | processx,
13 | attempt,
14 | DT,
15 | glue,
16 | htmltools
17 | Remotes:
18 | Thinkr-open/golem
19 | RoxygenNote: 7.1.1
20 | URL: https://github.com/colinfay/golemexample
21 | BugReports: https://github.com/colinfay/golemexample/issues
22 | Suggests:
23 | testthat
24 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/NAMESPACE:
--------------------------------------------------------------------------------
1 | # Generated by roxygen2: do not edit by hand
2 |
3 | export(mod_my_fifth_module_server)
4 | export(mod_my_fifth_module_ui)
5 | export(mod_my_first_module_server)
6 | export(mod_my_first_module_ui)
7 | export(mod_my_fourth_module_server)
8 | export(mod_my_fourth_module_ui)
9 | export(mod_my_other_module_server)
10 | export(mod_my_other_module_ui)
11 | export(mod_my_third_module_server)
12 | export(mod_my_third_module_ui)
13 | export(run_app)
14 | import(golem)
15 | import(shiny)
16 | importFrom(config,get)
17 | importFrom(glue,glue)
18 | importFrom(golem,with_golem_options)
19 | importFrom(htmltools,HTML)
20 | importFrom(htmltools,tagAppendAttributes)
21 | importFrom(htmltools,tagList)
22 | importFrom(htmltools,tags)
23 | importFrom(shiny,NS)
24 | importFrom(shiny,column)
25 | importFrom(shiny,shinyApp)
26 | importFrom(shiny,tagList)
27 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/NEWS.md:
--------------------------------------------------------------------------------
1 | # golemexample 0.0.0.9000
2 |
3 | * Added a `NEWS.md` file to track changes to the package.
4 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/app_config.R:
--------------------------------------------------------------------------------
1 | #' Access files in the current app
2 | #'
3 | #' @param ... Character vector specifying directory and or file to
4 | #' point to inside the current package.
5 | #'
6 | #' @noRd
7 | app_sys <- function(...){
8 | system.file(..., package = "golemexample")
9 | }
10 |
11 |
12 | #' Read App Config
13 | #'
14 | #' @param value Value to retrieve from the config file.
15 | #' @param config R_CONFIG_ACTIVE value.
16 | #' @param use_parent Logical, scan the parent directory for config file.
17 | #'
18 | #' @importFrom config get
19 | #'
20 | #' @noRd
21 | get_golem_config <- function(
22 | value,
23 | config = Sys.getenv("R_CONFIG_ACTIVE", "default"),
24 | use_parent = TRUE
25 | ){
26 | config::get(
27 | value = value,
28 | config = config,
29 | # Modify this if your config file is somewhere else:
30 | file = app_sys("golem-config.yml"),
31 | use_parent = use_parent
32 | )
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/app_server.R:
--------------------------------------------------------------------------------
1 | #' @import shiny
2 | #' @import golem
3 | app_server <- function(input, output,session) {
4 | # List the first level callModules here
5 | print(get_golem_options("time"))
6 | r <- reactiveValues()
7 | callModule(mod_my_first_module_server, "my_first_module_ui_1")
8 | callModule(mod_my_other_module_server, "my_other_module_ui_1", r)
9 | callModule(mod_my_third_module_server, "my_third_module_ui_1", r)
10 | callModule(mod_my_fourth_module_server, "my_fourth_module_ui_1")
11 | }
12 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/app_ui.R:
--------------------------------------------------------------------------------
1 | #' @import shiny
2 | app_ui <- function() {
3 | tagList(
4 | # Leave this function for adding external resources
5 | golem_add_external_resources(),
6 | # List the first level UI elements here
7 | fluidPage(
8 | h1(get_golem_options("name")),
9 | mod_my_first_module_ui("my_first_module_ui_1"),
10 | col_12(
11 | br()
12 | ),
13 | col_6(
14 | mod_my_other_module_ui("my_other_module_ui_1") %>% div(align = "center")
15 | ),
16 | col_6(
17 | mod_my_third_module_ui("my_third_module_ui_1") %>% div(align = "center")
18 | ),
19 | col_6(
20 | mod_my_fourth_module_ui("my_fourth_module_ui_1") %>% div(align = "center")
21 | ),
22 | col_6(
23 | mod_my_fifth_module_ui("my_fifth_module_ui_1") %>% div(align = "left")
24 | )
25 | )
26 | )
27 | }
28 |
29 | #' @import shiny
30 | golem_add_external_resources <- function(){
31 |
32 | addResourcePath(
33 | 'www', system.file('app/www', package = 'golemexample')
34 | )
35 |
36 | tags$head(
37 | golem::activate_js(),
38 | golem::favicon(),
39 | # Add here all the external resources
40 | # If you have a custom.css in the inst/app/www
41 | # Or for example, you can add shinyalert::useShinyalert() here
42 | tags$link(rel="stylesheet", type="text/css", href="www/custom.css"),
43 | tags$script(src="www/alertme.js"),
44 | tags$script(src="www/handlers.js")
45 | )
46 | }
47 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/golem_utils_server.R:
--------------------------------------------------------------------------------
1 | # Inverted versions of in, is.null and is.na
2 | `%not_in%` <- Negate(`%in%`)
3 |
4 | not_null <- Negate(is.null)
5 |
6 | not_na <- Negate(is.na)
7 |
8 | # Removes the null from a vector
9 | drop_nulls <- function(x){
10 | x[!sapply(x, is.null)]
11 | }
12 |
13 | # If x is null, return y, otherwise return x
14 | "%||%" <- function(x, y){
15 | if (is.null(x)) {
16 | y
17 | } else {
18 | x
19 | }
20 | }
21 | # If x is NA, return y, otherwise return x
22 | "%|NA|%" <- function(x, y){
23 | if (is.na(x)) {
24 | y
25 | } else {
26 | x
27 | }
28 | }
29 |
30 | # typing reactiveValues is too long
31 | rv <- shiny::reactiveValues
32 | rvtl <- shiny::reactiveValuesToList
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/mod_my_fifth_module.R:
--------------------------------------------------------------------------------
1 | # Module UI
2 |
3 | #' @title mod_my_fifth_module_ui and mod_my_fifth_module_server
4 | #' @description A shiny Module.
5 | #'
6 | #' @param id shiny id
7 | #' @param input internal
8 | #' @param output internal
9 | #' @param session internal
10 | #'
11 | #' @rdname mod_my_fifth_module
12 | #'
13 | #' @keywords internal
14 | #' @export
15 | #' @importFrom shiny NS tagList
16 | mod_my_fifth_module_ui <- function(id){
17 | ns <- NS(id)
18 | tagList(
19 | includeMarkdown(
20 | system.file("app/www/plop.md", package = "golemexample")
21 | )
22 | )
23 | }
24 |
25 | # Module Server
26 |
27 | #' @rdname mod_my_fifth_module
28 | #' @export
29 | #' @keywords internal
30 |
31 | mod_my_fifth_module_server <- function(input, output, session){
32 | ns <- session$ns
33 | }
34 |
35 | ## To be copied in the UI
36 | #
37 |
38 | ## To be copied in the server
39 | # callModule(mod_my_fifth_module_server, "my_fifth_module_ui_1")
40 |
41 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/mod_my_first_module.R:
--------------------------------------------------------------------------------
1 | # Module UI
2 |
3 | #' @title mod_my_first_module_ui and mod_my_first_module_server
4 | #' @description A shiny Module.
5 | #'
6 | #' @param id shiny id
7 | #' @param input internal
8 | #' @param output internal
9 | #' @param session internal
10 | #'
11 | #' @rdname mod_my_first_module
12 | #'
13 | #' @keywords internal
14 | #' @export
15 | #' @importFrom shiny NS tagList
16 | mod_my_first_module_ui <- function(id){
17 | ns <- NS(id)
18 | tagList(
19 | col_6(
20 | tags$div(
21 | align = "center",
22 | tags$img(
23 | src = "www/guit.jpg", width = "50%", align = "center"
24 | )
25 | )
26 | ),
27 | col_6(
28 | tableOutput(ns("df"))
29 | ),
30 | col_6(
31 | tags$div(
32 | align = "center",
33 | tags$button("Alert!", onclick = "alertme();")
34 | )
35 | ),
36 | col_6(
37 | tags$div(
38 | align = "center",
39 | actionButton(ns("go"), "Go!")
40 | )
41 | )
42 | )
43 | }
44 |
45 | # Module Server
46 |
47 | #' @rdname mod_my_first_module
48 | #' @export
49 | #' @keywords internal
50 |
51 | mod_my_first_module_server <- function(input, output, session, r){
52 | ns <- session$ns
53 | output$df <- renderTable({
54 | dataset
55 | })
56 |
57 | observeEvent( input$go , {
58 | golem::invoke_js("alertarg", "12")
59 | })
60 |
61 | }
62 |
63 | #' my_first_module UI Function
64 | #'
65 | #' @description A shiny Module.
66 | #'
67 | #' @param id,input,output,session Internal parameters for {shiny}.
68 | #'
69 | #' @noRd
70 | #'
71 | #' @importFrom shiny NS tagList
72 | mod_my_first_module_ui <- function(id){
73 | ns <- NS(id)
74 | tagList(
75 |
76 | )
77 | }
78 |
79 | #' my_first_module Server Function
80 | #'
81 | #' @noRd
82 | mod_my_first_module_server <- function(input, output, session){
83 | ns <- session$ns
84 |
85 | }
86 |
87 | ## To be copied in the UI
88 | # mod_my_first_module_ui("my_first_module_ui_1")
89 |
90 | ## To be copied in the server
91 | # callModule(mod_my_first_module_server, "my_first_module_ui_1")
92 |
93 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/mod_my_fourth_module.R:
--------------------------------------------------------------------------------
1 | # Module UI
2 |
3 | #' @title mod_my_fourth_module_ui and mod_my_fourth_module_server
4 | #' @description A shiny Module.
5 | #'
6 | #' @param id shiny id
7 | #' @param input internal
8 | #' @param output internal
9 | #' @param session internal
10 | #'
11 | #' @rdname mod_my_fourth_module
12 | #'
13 | #' @keywords internal
14 | #' @export
15 | #' @importFrom shiny NS tagList
16 | mod_my_fourth_module_ui <- function(id){
17 | #browser()
18 | ns <- NS(id)
19 | tagList(
20 | h2(
21 | names(plop)
22 | ),
23 | verbatimTextOutput(ns("fruits"))
24 | )
25 | }
26 |
27 | # Module Server
28 |
29 | #' @rdname mod_my_fourth_module
30 | #' @export
31 | #' @keywords internal
32 |
33 | mod_my_fourth_module_server <- function(input, output, session){
34 | ns <- session$ns
35 | output$fruits <- renderPrint({
36 | plop
37 | })
38 | }
39 |
40 | ## To be copied in the UI
41 | #
42 |
43 | ## To be copied in the server
44 | #
45 |
46 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/mod_my_other_module.R:
--------------------------------------------------------------------------------
1 | # Module UI
2 |
3 | #' @title mod_my_other_module_ui and mod_my_other_module_server
4 | #' @description A shiny Module.
5 | #'
6 | #' @param id shiny id
7 | #' @param input internal
8 | #' @param output internal
9 | #' @param session internal
10 | #'
11 | #' @rdname mod_my_other_module
12 | #'
13 | #' @keywords internal
14 | #' @export
15 | #' @importFrom shiny NS tagList
16 | mod_my_other_module_ui <- function(id){
17 | ns <- NS(id)
18 | tagList(
19 | col_12(
20 | h3("Collecting value here in r"),
21 | selectInput(ns("which"), "Which ?", c("iris", "mtcars", "airquality"))
22 | )
23 | )
24 | }
25 |
26 | # Module Server
27 |
28 | #' @rdname mod_my_other_module
29 | #' @export
30 | #' @keywords internal
31 |
32 | mod_my_other_module_server <- function(input, output, session, r){
33 | ns <- session$ns
34 |
35 | r$my_other_module <- reactiveValues()
36 |
37 | observeEvent( input$which , {
38 | r$my_other_module$which <- input$which
39 | })
40 |
41 |
42 | }
43 |
44 | ## To be copied in the UI
45 | #
46 |
47 | ## To be copied in the server
48 | #
49 |
50 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/mod_my_third_module.R:
--------------------------------------------------------------------------------
1 | # Module UI
2 |
3 | #' @title mod_my_third_module_ui and mod_my_third_module_server
4 | #' @description A shiny Module.
5 | #'
6 | #' @param id shiny id
7 | #' @param input internal
8 | #' @param output internal
9 | #' @param session internal
10 | #'
11 | #' @rdname mod_my_third_module
12 | #'
13 | #' @keywords internal
14 | #' @export
15 | #' @importFrom shiny NS tagList
16 | mod_my_third_module_ui <- function(id){
17 | ns <- NS(id)
18 | tagList(
19 | tableOutput(ns("df"))
20 | )
21 | }
22 |
23 | # Module Server
24 |
25 | #' @rdname mod_my_third_module
26 | #' @export
27 | #' @keywords internal
28 |
29 | mod_my_third_module_server <- function(input, output, session, r){
30 | ns <- session$ns
31 | output$df <- renderTable({
32 | print(r$my_other_module$which)
33 | head(base::get(r$my_other_module$which), 10)
34 | })
35 | }
36 |
37 | ## To be copied in the UI
38 | #
39 |
40 | ## To be copied in the server
41 | #
42 |
43 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/R/run_app.R:
--------------------------------------------------------------------------------
1 | #' Run the Shiny Application
2 | #'
3 | #' @export
4 | #' @importFrom shiny shinyApp
5 | #' @importFrom golem with_golem_options
6 | run_app <- function(
7 | name = "example",
8 | time = Sys.time(),
9 | port = 2811
10 | ) {
11 | with_golem_options(
12 | app = shinyApp(ui = app_ui,
13 | server = app_server,
14 | options = list(port = port)),
15 | golem_opts = list(name = name, time = time)
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/README.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | output: github_document
3 | ---
4 |
5 |
6 |
7 | ```{r, include = FALSE}
8 | knitr::opts_chunk$set(
9 | collapse = TRUE,
10 | comment = "#>",
11 | fig.path = "man/figures/README-",
12 | out.width = "100%"
13 | )
14 | ```
15 | # golemexample
16 |
17 |
18 | [](https://www.tidyverse.org/lifecycle/#experimental)
19 |
20 |
21 | The goal of golemexample is to provide some examples for the inner configuration of a `{golem}` app.
22 |
23 | ## Share value across modules
24 |
25 | + Add a top level reactiveValue
26 |
27 | + Add a nested level inside modules
28 |
29 | + Share this across modules
30 |
31 | ## Change Shiny Options
32 |
33 |
34 |
35 | ## Adding external files
36 |
37 | ### CSS
38 |
39 | + Added with `dev/02_dev.R#29`
40 |
41 | + Personnalized in `inst/app/www/custom.css`
42 |
43 | + Linked to the app at `R/app_ui.R#27`
44 |
45 | ### JS
46 |
47 | #### Classic
48 |
49 | __A simple JS can be used from UI.__
50 |
51 | + Added with `dev/02_dev.R#27`
52 |
53 | + Personnalized in `inst/app/www/alertme.js`
54 |
55 | + Linked to the app at `R/app_ui.R#28`
56 |
57 | + Called with `tags$button("Alert!", onclick = "alertme();")` at `R/mod_my_first_module.R#33`
58 |
59 | #### Handlers
60 |
61 | __A handler JS can be used from server side with `golem::invoke_js()`.__
62 |
63 | + Added with `dev/02_dev.R#28`
64 |
65 | + Personnalized in `inst/app/www/handler.js`
66 |
67 | + Linked to the app at `R/app_ui.R#29`
68 |
69 | + Called with `golem::invoke_js("alertarg", "12")` at `R/mod_my_first_module.R#58`
70 |
71 | ### Image
72 |
73 | + Downloaded at `inst/app/www/guit.jpg`
74 |
75 | + Linked with `tags$img(src = "www/guit.jpg")` at `R/mod_my_first_module.R#23`
76 |
77 | ## Passing arguments to `run_app`
78 |
79 | + `run_app`
80 |
81 | + Read in UI at `R/app_ui.R#8`
82 |
83 | + Read in server at `R/app_server.R#5`
84 |
85 | ## Using datasets inside your app
86 |
87 | + Register your dataset as a package data
88 | which is turned into
89 |
90 | + Use your data object wherever you need it (in your UI or server)
91 |
92 | ## Using shiny::includeXXX
93 |
94 | + Add elements in `inst/app/www`
95 |
96 | + Use `system.file("app/www/plop.md", package = "golemexample")`
97 |
98 |
99 |
100 | Please note that the 'golemexample' project is released with a
101 | [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
102 | By contributing to this project, you agree to abide by its terms.
103 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/config.yml:
--------------------------------------------------------------------------------
1 | language: R
2 | r_packages:
3 | - package: r-dt
4 | method: conda
5 | channel: conda-forge
6 | - package: r-golem
7 | method: conda
8 | channel: conda-forge
9 | title: R golem Example
10 | version: 3.7
11 | type: golem
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/data-raw/dataset.R:
--------------------------------------------------------------------------------
1 | ## code to prepare `dataset` dataset goes here
2 |
3 | dataset <- head(mtcars)
4 | usethis::use_data(dataset)
5 |
6 | plop <- list(
7 | fruits = stringr::fruit
8 | )
9 |
10 | usethis::use_data(plop)
11 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/data/dataset.rda:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/10-golemexample-master/data/dataset.rda
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/data/plop.rda:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/10-golemexample-master/data/plop.rda
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/dev/01_start.R:
--------------------------------------------------------------------------------
1 | # Building a Prod-Ready, Robust Shiny Application.
2 | #
3 | # Each step is optional.
4 | #
5 | # 1 - On init
6 | #
7 | ## 1.1 - Fill the descripion & set options
8 | ##
9 | ## Add information about the package that will contain your app
10 |
11 | golem::fill_desc(
12 | pkg_name = "golemexample", # The Name of the package containing the App
13 | pkg_title = "Golem Example", # The Title of the package containing the App
14 | pkg_description = "A Package to show the basics of a golem.", # The Description of the package containing the App
15 | author_first_name = "Colin", # Your First Name
16 | author_last_name = "Fay", # Your Last Name
17 | author_email = "contact@colinfay.me", # Your Email
18 | repo_url = "https://github.com/colinfay/golemexample" # The (optional) URL of the GitHub Repo
19 | )
20 |
21 | ## Use this desc to set {golem} options
22 |
23 | golem::set_golem_options()
24 |
25 | ## 1.2 - Set common Files
26 | ##
27 | ## If you want to use the MIT licence, README, code of conduct, lifecycle badge, and news
28 |
29 | usethis::use_mit_license( name = "Colin Fay" ) # You can set another licence here
30 | usethis::use_readme_rmd( open = FALSE )
31 | usethis::use_code_of_conduct()
32 | usethis::use_lifecycle_badge( "Experimental" )
33 |
34 | usethis::use_news_md( open = FALSE )
35 | usethis::use_git()
36 |
37 | ## 1.3 - Add a data-raw folder
38 | ##
39 | ## If you have data in your package
40 | usethis::use_data_raw( name = "dataset", open = FALSE ) # Change "my_dataset"
41 |
42 | ## 1.4 - Init Tests
43 | ##
44 | ## Create a template for tests
45 |
46 | golem::use_recommended_tests()
47 |
48 | ## 1.5 : Use Recommended Package
49 |
50 | golem::use_recommended_deps()
51 |
52 | ## 1.6 Add various tools
53 |
54 | # If you want to change the favicon (default is golem's one)
55 | golem::remove_favicon()
56 | golem::use_favicon("") # path = "path/to/ico". Can be an online file.
57 |
58 | # Add helper functions
59 | golem::use_utils_ui()
60 | golem::use_utils_server()
61 |
62 | # You're now set!
63 | # go to dev/02_dev.R
64 | rstudioapi::navigateToFile( "dev/02_dev.R" )
65 |
66 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/dev/02_dev.R:
--------------------------------------------------------------------------------
1 | # Building a Prod-Ready, Robust Shiny Application.
2 | #
3 | # Each step is optional.
4 | #
5 |
6 | # 2. All along your project
7 |
8 | ## 2.1 Add modules
9 | ##
10 | golem::add_module( name = "my_first_module" ) # Name of the module
11 | golem::add_module( name = "my_other_module" ) # Name of the module
12 | golem::add_module( name = "my_third_module" ) # Name of the module
13 | golem::add_module( name = "my_fourth_module" ) # Name of the module
14 |
15 | ## 2.2 Add dependencies
16 |
17 | usethis::use_package( "thinkr" ) # To call each time you need a new package
18 |
19 | ## 2.3 Add tests
20 |
21 | usethis::use_test( "app" )
22 |
23 | ## 2.4 Add a browser button
24 |
25 | golem::browser_button()
26 |
27 | ## 2.5 Add external files
28 |
29 | golem::add_js_file( "alertme" )
30 | golem::add_js_handler( "handlers" )
31 | golem::add_css_file( "custom" )
32 |
33 | # 3. Documentation
34 |
35 | ## 3.1 Vignette
36 | usethis::use_vignette("golemexample")
37 | devtools::build_vignettes()
38 |
39 | ## 3.2 Code coverage
40 | ## You'll need GitHub there
41 | usethis::use_github()
42 | usethis::use_travis()
43 | usethis::use_appveyor()
44 |
45 | # You're now set!
46 | # go to dev/03_deploy.R
47 | rstudioapi::navigateToFile("dev/03_deploy.R")
48 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/dev/03_deploy.R:
--------------------------------------------------------------------------------
1 | # Deploy a Prod-Ready, Robust Shiny Application.
2 | #
3 | # 4. Test my package
4 |
5 | devtools::test()
6 | rhub::check_for_cran()
7 |
8 | # 5. Deployment elements
9 |
10 | ## 5.1 If you want to deploy on RStudio related platforms
11 | golem::add_rstudioconnect_file()
12 | golem::add_shinyappsio_file()
13 | golem::add_shinyserver_file()
14 |
15 | ## 5.2 If you want to deploy via a generic Dockerfile
16 | golem::add_dockerfile()
17 |
18 | ## 5.2 If you want to deploy to ShinyProxy
19 | golem::add_dockerfile_shinyproxy()
20 |
21 | ## 5.2 If you want to deploy to Heroku
22 | golem::add_dockerfile_heroku()
23 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/dev/run_dev.R:
--------------------------------------------------------------------------------
1 | # Set options here
2 | options(golem.app.prod = FALSE) # TRUE = production mode, FALSE = development mode
3 |
4 | # Detach all loaded packages and clean your environment
5 | golem::detach_all_attached()
6 | # rm(list=ls(all.names = TRUE))
7 |
8 | # Document and reload your package
9 | golem::document_and_reload()
10 |
11 | # Run the application
12 | run_app()
13 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/golem-config.yml:
--------------------------------------------------------------------------------
1 | default:
2 | golem_name: golemexample
3 | golem_version: 0.0.0.9000
4 | app_prod: no
5 | production:
6 | app_prod: yes
7 | dev:
8 | golem_wd: !expr here::here()
9 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/golemexample.Rproj:
--------------------------------------------------------------------------------
1 | Version: 1.0
2 |
3 | RestoreWorkspace: Default
4 | SaveWorkspace: Default
5 | AlwaysSaveHistory: Default
6 |
7 | EnableCodeIndexing: Yes
8 | UseSpacesForTab: Yes
9 | NumSpacesForTab: 2
10 | Encoding: UTF-8
11 |
12 | RnwWeave: Sweave
13 | LaTeX: pdfLaTeX
14 |
15 | BuildType: Package
16 | PackageUseDevtools: Yes
17 | PackageInstallArgs: --no-multiarch --with-keep.source
18 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/inst/app/www/alertme.js:
--------------------------------------------------------------------------------
1 | alertme = function(){
2 | alert("simple js!");
3 | }
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/inst/app/www/custom.css:
--------------------------------------------------------------------------------
1 | h1 {
2 | color: pink;
3 | }
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/inst/app/www/guit.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/10-golemexample-master/inst/app/www/guit.jpg
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/inst/app/www/handlers.js:
--------------------------------------------------------------------------------
1 | $( document ).ready(function() {
2 | Shiny.addCustomMessageHandler('alertarg', function(arg) {
3 | alert(arg);
4 | })
5 | });
6 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/inst/app/www/plop.md:
--------------------------------------------------------------------------------
1 | ## An example of an included markdown
2 |
3 | Note that external markdown can be put in inst/app/www/ or anywhere inst/.
4 |
5 | `addResourcePath()` adds a link __available at runtime__, i.e while your app is served in your browser.
6 |
7 | Including an external JS or HTML is to be done like this:
8 |
9 | ``` r
10 | includeMarkdown(
11 | system.file("app/www/plop.md", package = "golemexample")
12 | )
13 | ```
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/mod_my_fifth_module.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/mod_my_fifth_module.R
3 | \name{mod_my_fifth_module_ui}
4 | \alias{mod_my_fifth_module_ui}
5 | \alias{mod_my_fifth_module_server}
6 | \title{mod_my_fifth_module_ui and mod_my_fifth_module_server}
7 | \usage{
8 | mod_my_fifth_module_ui(id)
9 |
10 | mod_my_fifth_module_server(input, output, session)
11 | }
12 | \arguments{
13 | \item{id}{shiny id}
14 |
15 | \item{input}{internal}
16 |
17 | \item{output}{internal}
18 |
19 | \item{session}{internal}
20 | }
21 | \description{
22 | A shiny Module.
23 | }
24 | \keyword{internal}
25 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/mod_my_first_module.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/mod_my_first_module.R
3 | \name{mod_my_first_module_ui}
4 | \alias{mod_my_first_module_ui}
5 | \alias{mod_my_first_module_server}
6 | \title{mod_my_first_module_ui and mod_my_first_module_server}
7 | \usage{
8 | mod_my_first_module_ui(id)
9 |
10 | mod_my_first_module_server(input, output, session)
11 | }
12 | \arguments{
13 | \item{id}{shiny id}
14 |
15 | \item{input}{internal}
16 |
17 | \item{output}{internal}
18 |
19 | \item{session}{internal}
20 | }
21 | \description{
22 | A shiny Module.
23 | }
24 | \keyword{internal}
25 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/mod_my_fourth_module.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/mod_my_fourth_module.R
3 | \name{mod_my_fourth_module_ui}
4 | \alias{mod_my_fourth_module_ui}
5 | \alias{mod_my_fourth_module_server}
6 | \title{mod_my_fourth_module_ui and mod_my_fourth_module_server}
7 | \usage{
8 | mod_my_fourth_module_ui(id)
9 |
10 | mod_my_fourth_module_server(input, output, session)
11 | }
12 | \arguments{
13 | \item{id}{shiny id}
14 |
15 | \item{input}{internal}
16 |
17 | \item{output}{internal}
18 |
19 | \item{session}{internal}
20 | }
21 | \description{
22 | A shiny Module.
23 | }
24 | \keyword{internal}
25 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/mod_my_other_module.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/mod_my_other_module.R
3 | \name{mod_my_other_module_ui}
4 | \alias{mod_my_other_module_ui}
5 | \alias{mod_my_other_module_server}
6 | \title{mod_my_other_module_ui and mod_my_other_module_server}
7 | \usage{
8 | mod_my_other_module_ui(id)
9 |
10 | mod_my_other_module_server(input, output, session, r)
11 | }
12 | \arguments{
13 | \item{id}{shiny id}
14 |
15 | \item{input}{internal}
16 |
17 | \item{output}{internal}
18 |
19 | \item{session}{internal}
20 | }
21 | \description{
22 | A shiny Module.
23 | }
24 | \keyword{internal}
25 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/mod_my_third_module.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/mod_my_third_module.R
3 | \name{mod_my_third_module_ui}
4 | \alias{mod_my_third_module_ui}
5 | \alias{mod_my_third_module_server}
6 | \title{mod_my_third_module_ui and mod_my_third_module_server}
7 | \usage{
8 | mod_my_third_module_ui(id)
9 |
10 | mod_my_third_module_server(input, output, session, r)
11 | }
12 | \arguments{
13 | \item{id}{shiny id}
14 |
15 | \item{input}{internal}
16 |
17 | \item{output}{internal}
18 |
19 | \item{session}{internal}
20 | }
21 | \description{
22 | A shiny Module.
23 | }
24 | \keyword{internal}
25 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/man/run_app.Rd:
--------------------------------------------------------------------------------
1 | % Generated by roxygen2: do not edit by hand
2 | % Please edit documentation in R/run_app.R
3 | \name{run_app}
4 | \alias{run_app}
5 | \title{Run the Shiny Application}
6 | \usage{
7 | run_app(name = "example", time = Sys.time(), port = 2811)
8 | }
9 | \description{
10 | Run the Shiny Application
11 | }
12 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/run_zenreport.R:
--------------------------------------------------------------------------------
1 | # test if there is at least one argument: if not, return an error
2 | if (length(args)!=0) {
3 | stop("Please Provide Port Number", call.=FALSE)
4 | } else if (length(args)==1) {
5 | # default output file
6 | print(args)
7 | port = as.numeric(args[1])
8 | print(port)
9 | }
10 |
11 | # Set options here
12 | options(golem.app.prod = TRUE) # TRUE = production mode, FALSE = development mode
13 |
14 | # Detach all loaded packages and clean your environment
15 | golem::detach_all_attached()
16 | # rm(list=ls(all.names = TRUE))
17 |
18 | # Document and reload your package
19 | golem::document_and_reload()
20 |
21 | # Run the application
22 | run_app(port=port)
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/tests/testthat.R:
--------------------------------------------------------------------------------
1 | library(testthat)
2 | library(golemexample)
3 |
4 | test_check("golemexample")
5 |
--------------------------------------------------------------------------------
/doc/publish_example/10-golemexample-master/tests/testthat/test-golem-recommended.R:
--------------------------------------------------------------------------------
1 | context("golem tests")
2 |
3 | library(golem)
4 |
5 | test_that("app ui", {
6 | ui <- app_ui()
7 | expect_shinytaglist(ui)
8 | })
9 |
10 | test_that("app server", {
11 | server <- app_server
12 | expect_is(server, "function")
13 | })
14 |
15 | # Configure this test to fit your need
16 | test_that(
17 | "app launches",{
18 | skip_on_cran()
19 | skip_on_travis()
20 | skip_on_appveyor()
21 | x <- processx::process$new(
22 | "R",
23 | c(
24 | "-e",
25 | "setwd('../../'); pkgload::load_all();run_app()"
26 | )
27 | )
28 | Sys.sleep(5)
29 | expect_true(x$is_alive())
30 | x$kill()
31 | }
32 | )
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/doc/publish_example/11-r-pdf/config.yml:
--------------------------------------------------------------------------------
1 | language: R
2 | r_packages:
3 | - package: r-rmarkdown
4 | method: conda
5 | channel: conda-forge
6 | title: r-pdf-example
7 | type: Markdown
8 | version: 3.5
--------------------------------------------------------------------------------
/doc/publish_example/11-r-pdf/test.Rmd:
--------------------------------------------------------------------------------
1 | ---
2 | title: "test"
3 | author: "Dr. P. B. Patel"
4 | output: pdf_document
5 | ---
6 |
7 | ```{r setup, include=FALSE}
8 | knitr::opts_chunk$set(echo = TRUE)
9 | ```
10 |
11 | ## R Markdown
12 |
13 | This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see .
14 |
15 | When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
16 |
17 | ```{r cars}
18 | summary(cars)
19 | ```
20 |
21 | ## Including Plots
22 |
23 | You can also embed plots, for example:
24 |
25 | ```{r pressure, echo= TRUE, fig.height=3, fig.width=4}
26 | plot(pressure)
27 | ```
28 |
29 | Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
30 |
31 |
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/config.yml:
--------------------------------------------------------------------------------
1 | language: R
2 | r_packages:
3 | - package: r-nortest
4 | method: conda
5 | channel: conda-forge
6 | - package: r-tseries
7 | method: conda
8 | channel: conda-forge
9 | - package: r-RcmdrMisc
10 | method: conda
11 | channel: conda-forge
12 | - package: r-lmtest
13 | method: conda
14 | channel: conda-forge
15 | - package: r-shiny
16 | method: conda
17 | channel: conda-forge
18 | - package: r-shinythemes
19 | method: conda
20 | channel: conda-forge
21 | - package: tidyverse/ggplot2
22 | method: github
23 | - package: tseries
24 | method: cran
25 | - package: DT
26 | code: install.packages("DT", dependencies = TRUE, repos = "http://cran.us.r-project.org")
27 | title: R shiny Example
28 | type: shiny
29 | version: 3.6
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Antioquia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Antioquia.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Gobernacion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Gobernacion.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Scatter1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Scatter1.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Scatter2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Scatter2.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Scatter3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Scatter3.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/Scatter4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/Scatter4.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/border.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/border2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/border2.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/border3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/border3.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/border4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/border4.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/collage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/collage.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/qqNorm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/qqNorm.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/scatter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/scatter.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/summary1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/summary1.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/summary2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/summary2.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/summary3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/summary3.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/summary4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/summary4.png
--------------------------------------------------------------------------------
/doc/publish_example/12-Regression-master/www/summary5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/12-Regression-master/www/summary5.png
--------------------------------------------------------------------------------
/doc/publish_example/2-just-image/config.yml:
--------------------------------------------------------------------------------
1 | language: image
2 | title: publish just image
3 | type: png
4 |
--------------------------------------------------------------------------------
/doc/publish_example/2-just-image/datascience.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/2-just-image/datascience.png
--------------------------------------------------------------------------------
/doc/publish_example/3-jupyter-notebook-python/config.yml:
--------------------------------------------------------------------------------
1 | format: html
2 | language: python
3 | python_conda_packages:
4 | jupyter: latest
5 | matplotlib: latest
6 | seaborn: latest
7 | title: jupyter notebook example
8 | type: Jupyter
9 | version: 3.6
10 | recreate: true
--------------------------------------------------------------------------------
/doc/publish_example/4-just-json/config.yml:
--------------------------------------------------------------------------------
1 | language: data
2 | title: publish json example
3 | type: json
4 |
--------------------------------------------------------------------------------
/doc/publish_example/4-just-json/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": 1,
3 | "test" : "test",
4 | "test1": {
5 | "test": "Test",
6 | "mytest": "myh"
7 | }
8 | }
--------------------------------------------------------------------------------
/doc/publish_example/5-just-pdf/c4611_sample_explain.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/5-just-pdf/c4611_sample_explain.pdf
--------------------------------------------------------------------------------
/doc/publish_example/5-just-pdf/config.yml:
--------------------------------------------------------------------------------
1 | language: pdf
2 | title: publish pdf example
3 | type: pdf
4 | all_ids:
5 | local: '2'
6 |
--------------------------------------------------------------------------------
/doc/publish_example/6-just-yml/config.yml:
--------------------------------------------------------------------------------
1 | language: data
2 | title: publish yml example
3 | type: yml
--------------------------------------------------------------------------------
/doc/publish_example/6-just-yml/test.yml:
--------------------------------------------------------------------------------
1 | test : test
2 | mytest: mytest
3 | select :
4 | - test: test
5 | - test2: test2
--------------------------------------------------------------------------------
/doc/publish_example/7-streamlit-dataview-master/README.md:
--------------------------------------------------------------------------------
1 | ## Gravitational Wave Quickview App
2 |
3 | This app downloads and displays a few seconds of data from the [Gravitational Wave Open Science Center](https://gw-osc.org).
4 |
5 | [](https://share.streamlit.io/jkanner/streamlit-dataview/app.py)
6 |
--------------------------------------------------------------------------------
/doc/publish_example/7-streamlit-dataview-master/config.yml:
--------------------------------------------------------------------------------
1 | language: python
2 | requirement: true
3 | title: streamlit example
4 | type: Streamlit
5 | version: 3.7
--------------------------------------------------------------------------------
/doc/publish_example/7-streamlit-dataview-master/requirements.txt:
--------------------------------------------------------------------------------
1 | streamlit==0.70.0
2 | gwpy==1.0.1
3 | matplotlib==3.3.0
4 | numpy
5 |
6 |
--------------------------------------------------------------------------------
/doc/publish_example/8-r-html/config.yml:
--------------------------------------------------------------------------------
1 | language: R
2 | r_cran_packages:
3 | MASS: latest
4 | dplyr: latest
5 | ggplot2: latest
6 | gtable: latest
7 | isoband: latest
8 | knitr: latest
9 | lubridate: latest
10 | mgcv: latest
11 | prettydoc: latest
12 | scales: latest
13 | rmarkdown: latest
14 | title: R-example-html
15 | type: markdown
16 | version: 3.4
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/config.yml:
--------------------------------------------------------------------------------
1 | language: R
2 | r_cran_packages:
3 | MASS: latest
4 | dplyr: latest
5 | ggplot2: latest
6 | gtable: latest
7 | isoband: latest
8 | knitr: latest
9 | lubridate: latest
10 | mgcv: latest
11 | prettydoc: latest
12 | scales: latest
13 | rmarkdown: latest
14 | title: r html example 2
15 | type: markdown
16 | version: 3.4
17 | recreate: true
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-2-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-2-1.png
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-3-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-3-1.png
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-4-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-4-1.png
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-5-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-5-1.png
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-6-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-6-1.png
--------------------------------------------------------------------------------
/doc/publish_example/9-r-html-2/figure/unnamed-chunk-7-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/doc/publish_example/9-r-html-2/figure/unnamed-chunk-7-1.png
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parser": "@typescript-eslint/parser",
4 | "parserOptions": {
5 | "ecmaVersion": 6,
6 | "sourceType": "module"
7 | },
8 | "plugins": [
9 | "@typescript-eslint"
10 | ],
11 | "rules": {
12 | "@typescript-eslint/naming-convention": "warn",
13 | "@typescript-eslint/semi": "warn",
14 | "curly": "warn",
15 | "eqeqeq": "warn",
16 | "no-throw-literal": "warn",
17 | "semi": "off"
18 | },
19 | "ignorePatterns": [
20 | "out",
21 | "dist",
22 | "**/*.d.ts"
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that compiles the extension and then opens it inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "args": [
13 | "--extensionDevelopmentPath=${workspaceFolder}"
14 | ],
15 | "outFiles": [
16 | "${workspaceFolder}/dist/**/*.js"
17 | ],
18 | "preLaunchTask": "${defaultBuildTask}"
19 | },
20 | {
21 | "name": "Extension Tests",
22 | "type": "extensionHost",
23 | "request": "launch",
24 | "args": [
25 | "--extensionDevelopmentPath=${workspaceFolder}",
26 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27 | ],
28 | "outFiles": [
29 | "${workspaceFolder}/out/**/*.js",
30 | "${workspaceFolder}/dist/**/*.js"
31 | ],
32 | "preLaunchTask": "tasks: watch-tests"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | // Place your settings in this file to overwrite default and user settings.
2 | {
3 | "files.exclude": {
4 | "out": false, // set this to true to hide the "out" folder with the compiled JS files
5 | "dist": false // set this to true to hide the "dist" folder with the compiled JS files
6 | },
7 | "search.exclude": {
8 | "out": true, // set this to false to include "out" folder in search results
9 | "dist": true // set this to false to include "dist" folder in search results
10 | },
11 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts
12 | "typescript.tsc.autoDetect": "off"
13 | }
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | // See https://go.microsoft.com/fwlink/?LinkId=733558
2 | // for the documentation about the tasks.json format
3 | {
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "type": "npm",
8 | "script": "watch",
9 | "problemMatcher": [
10 | "$ts-webpack-watch",
11 | "$tslint-webpack-watch"
12 | ],
13 | "isBackground": true,
14 | "presentation": {
15 | "reveal": "never",
16 | "group": "watchers"
17 | },
18 | "group": {
19 | "kind": "build",
20 | "isDefault": true
21 | }
22 | },
23 | {
24 | "type": "npm",
25 | "script": "watch-tests",
26 | "problemMatcher": "$tsc-watch",
27 | "isBackground": true,
28 | "presentation": {
29 | "reveal": "never",
30 | "group": "watchers"
31 | },
32 | "group": "build"
33 | },
34 | {
35 | "label": "tasks: watch-tests",
36 | "dependsOn": [
37 | "npm: watch",
38 | "npm: watch-tests"
39 | ],
40 | "problemMatcher": []
41 | }
42 | ]
43 | }
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | out/**
4 | node_modules/**
5 | src/**
6 | .gitignore
7 | .yarnrc
8 | webpack.config.js
9 | vsc-extension-quickstart.md
10 | **/tsconfig.json
11 | **/.eslintrc.json
12 | **/*.map
13 | **/*.ts
14 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to the "vscode-zen-knit" extension will be documented in this file.
4 |
5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6 |
7 | ## [0.0.5]
8 | - fix output folder issue
9 |
10 | ## [0.0.6]
11 | - show path location when build
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/README.md:
--------------------------------------------------------------------------------
1 | # vscode-zen-knit README
2 | Knit Documment by going to ctr + shift + P and search for knit document or
3 | use short cut cnt + alt + K
4 |
5 | Setting neeed to setup:
6 |
7 | knitPath: path of your knit (can be found by which knit)
8 |
9 | outputPath(optional): path where you want to store outout
10 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/dist/extension.js:
--------------------------------------------------------------------------------
1 | (()=>{"use strict";var e={470:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getOutput=t.getCommand=void 0;const i=n(37),r=n(496),o=n(81);t.getCommand=function(e){const t=r.workspace.getConfiguration("zen-knit").get(e+"Path");return new Promise(((n,r)=>{if(null==t)r(new Error(e+" not defined in config"));else{let a="";switch(i.platform()){case"win32":a="where "+t;break;case"linux":case"darwin":a="which "+t}o.exec(a,((i,o,a)=>{""!==o?n(t):r(new Error(e+" not defined in path"))}))}}))},t.getOutput=function(e){return r.workspace.getConfiguration("zen-knit").get(e+"Path")}},323:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatDoc=void 0;const i=n(496);t.formatDoc=function(e){return i.languages.registerDocumentFormattingEditProvider("zen-knit-format",{async provideDocumentFormattingEdits(e){return console.log("hi inside"),[i.TextEdit.replace((t=e,t.validateRange(new i.Range(0,0,Number.MAX_VALUE,Number.MAX_VALUE))),"")];var t}})}},104:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createchannel=void 0;const i=n(496);t.createchannel=function(){return i.window.createOutputChannel("Zen-Knit")}},72:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.knit=void 0;const i=n(496),r=n(17),o=n(470),a=n(81);t.knit=function(e){return i.commands.registerTextEditorCommand("vscode-zen-knit.build",(async()=>{if(i.window.activeTextEditor){const n=i.window.activeTextEditor.document,s=await(0,o.getCommand)("knit");var t=(0,o.getOutput)("output");let{dir:c}=r.parse(n.uri.path);void 0===t&&(t=c.toString());const u=new Date;e.appendLine("processing: "+n.uri.fsPath+" at: "+u.toISOString()),a.exec(s+" -f "+n.uri.fsPath+" -ofd "+t,((n,r,o)=>{if(e.appendLine(r),e.appendLine(o),n)return e.appendLine(n.message),void i.window.showErrorMessage("zen-knit : an error ocurred while building file");i.window.showInformationMessage("zen-knit : outputfile is build at "+t)}))}}))}},496:e=>{e.exports=require("vscode")},81:e=>{e.exports=require("child_process")},37:e=>{e.exports=require("os")},17:e=>{e.exports=require("path")}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}var i={};(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.deactivate=e.activate=void 0;const t=n(323),r=n(104),o=n(72);e.activate=function(e){const n=(0,r.createchannel)();n.appendLine('vscode-zen-knit" is now active!'),e.subscriptions.push((0,o.knit)(n)),e.subscriptions.push((0,t.formatDoc)(n))},e.deactivate=function(){}})(),module.exports=i})();
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vscode-zen-knit",
3 | "publisher": "ZenReportz",
4 | "repository": {
5 | "type": "git",
6 | "url": "https://github.com/Zen-Reportz/zen_knit/pulgins/vscode-zen-knit"
7 | },
8 | "displayName": "vscode-zen-knit",
9 | "description": "Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. RMarkdown alternative. Zen-Knit is good for creating reports, tutorials with embedded python. RMarkdown alternative. Python Markdown Support. ",
10 | "version": "0.0.6",
11 | "engines": {
12 | "vscode": "^1.63.0"
13 | },
14 | "categories": [
15 | "Other"
16 | ],
17 | "activationEvents": [
18 | "onCommand:vscode-zen-knit.build",
19 | "onLanguage:zen-knit-format"
20 | ],
21 | "main": "./dist/extension.js",
22 | "contributes": {
23 | "commands": [
24 | {
25 | "command": "vscode-zen-knit.build",
26 | "title": "Knit Document"
27 | },
28 | {
29 | "command": "zen-knit-format",
30 | "title": "Format pyz"
31 | }
32 | ],
33 | "configuration":[
34 | {
35 | "title": "zen-knit",
36 | "properties": {
37 | "zen-knit.knitPath": {
38 | "type": "string",
39 | "default": "/home/drpbpatel/Documents/git/zen/zen_knit/.venv/bin/knit",
40 | "description": "zen-knit path"
41 | },
42 | "zen-knit.outputPath": {
43 | "type": "string",
44 | "default": "/home/drpbpatel/Documents/git/zen/zen_knit/doc/example/output",
45 | "description": "zen-knit output folder"
46 | }
47 | }
48 | }
49 | ],
50 | "keybindings": [
51 | {
52 | "command": "vscode-zen-knit.build",
53 | "key": "ctrl+alt+k"
54 | }
55 | ],
56 | "languages": [
57 | {
58 | "id": "zen-knit-format",
59 | "aliases": [
60 | "Zen Knit format"
61 | ],
62 | "extensions": [
63 | "pyz"
64 | ]
65 | }
66 | ]
67 | },
68 | "scripts": {
69 | "vscode:prepublish": "npm run package",
70 | "compile": "webpack",
71 | "watch": "webpack --watch",
72 | "package": "webpack --mode production --devtool hidden-source-map",
73 | "compile-tests": "tsc -p . --outDir out",
74 | "watch-tests": "tsc -p . -w --outDir out",
75 | "pretest": "npm run compile-tests && npm run compile && npm run lint",
76 | "lint": "eslint src --ext ts",
77 | "test": "node ./out/test/runTest.js"
78 | },
79 | "devDependencies": {
80 | "@types/glob": "^7.2.0",
81 | "@types/mocha": "^9.0.0",
82 | "@types/node": "14.x",
83 | "@types/vscode": "^1.63.1",
84 | "@typescript-eslint/eslint-plugin": "^5.9.1",
85 | "@typescript-eslint/parser": "^5.9.1",
86 | "@vscode/test-electron": "^2.0.3",
87 | "eslint": "^8.6.0",
88 | "glob": "^7.2.0",
89 | "mocha": "^9.1.3",
90 | "ts-loader": "^9.2.6",
91 | "typescript": "^4.5.4",
92 | "webpack": "^5.66.0",
93 | "webpack-cli": "^4.9.1"
94 | },
95 | "dependencies": {
96 | "dataclass": "^2.0.0"
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/core/command_line.ts:
--------------------------------------------------------------------------------
1 |
2 | import os = require('os');
3 | import * as vscode from 'vscode';
4 | import cp = require('child_process');
5 | import { resolveCliPathFromVSCodeExecutablePath } from '@vscode/test-electron';
6 |
7 | export function getCommand(cmd: string): Promise {
8 | const configuration = vscode.workspace.getConfiguration('zen-knit');
9 | const command = configuration.get(cmd + 'Path');
10 |
11 | return new Promise((resolve, reject) => {
12 | if (command === null || command === undefined) {
13 | reject(new Error(cmd + ' not defined in config'));
14 | } else {
15 | let checkCommand: string = "";
16 | switch (os.platform()) {
17 | case "win32": checkCommand = 'where ' + command;
18 | break;
19 | case "linux":
20 | case "darwin":
21 | checkCommand = 'which ' + command;
22 |
23 | }
24 | cp.exec(checkCommand, (error, stdout, stderr) => {
25 | if (stdout !== "") {
26 | resolve(command);
27 | }
28 | else {
29 | reject(new Error(cmd + ' not defined in path'));
30 | }
31 | });
32 | }
33 | });
34 | }
35 |
36 |
37 | export function getOutput(cmd: string): string {
38 | const configuration = vscode.workspace.getConfiguration('zen-knit');
39 | const command = configuration.get(cmd + 'Path');
40 | return command
41 | }
42 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/core/format.ts:
--------------------------------------------------------------------------------
1 | import * as vscode from 'vscode';
2 | import { getCommand } from './command_line';
3 | import cp = require('child_process');
4 |
5 | const fullRange = (doc: vscode.TextDocument) => doc.validateRange(new vscode.Range(0, 0, Number.MAX_VALUE, Number.MAX_VALUE));
6 |
7 | export function formatDoc(myChannel: vscode.OutputChannel){
8 | return vscode.languages.registerDocumentFormattingEditProvider('zen-knit-format', {
9 | async provideDocumentFormattingEdits(document: vscode.TextDocument): Promise {
10 | console.log("hi inside");
11 | // const fullText = document.getText();
12 | // myChannel.appendLine(fullText)
13 | let finalDocument = "";
14 | // const autopep8Command = await getCommand('autopep8');
15 | // // let nowebReplace = fullText.replace(/(<<.*?>>=)(.*?)(@)/gms, (_, openingTag, code, closingTag) => {
16 | // let nowebReplace = fullText.replace(/(<<[^<>]*>>=)(.*?)(@)/gms, (_, openingTag, code, closingTag) => {
17 | // let formattedPython = cp.execSync(autopep8Command + ' -', {
18 | // input: code
19 | // }).toString();
20 | // return "\\begin{noweb}\n" + openingTag + formattedPython + closingTag + "\n\\end{noweb}";
21 | // });
22 | // const latexindentCommand = await getCommand('latexindent');
23 | // let indentedDocument = cp.execSync(latexindentCommand + ' -y="verbatimEnvironments:noweb:1', {
24 | // input: nowebReplace
25 | // }).toString();
26 | // let finalDocument = indentedDocument.replace(/^\s*\\begin{noweb}.*?(<<.*?>>=.*?@).*?\\end{noweb}\h*$/gms, (_, code) => code);
27 | return [vscode.TextEdit.replace(fullRange(document), finalDocument)];
28 | }
29 | });
30 |
31 | }
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/core/knit_channel.ts:
--------------------------------------------------------------------------------
1 | import * as vscode from 'vscode';
2 |
3 | export function createchannel(){
4 | return vscode.window.createOutputChannel("Zen-Knit");
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/core/publish.ts:
--------------------------------------------------------------------------------
1 | import * as vscode from 'vscode';
2 | import path = require('path');
3 | import { getCommand, getOutput } from './command_line';
4 | import cp = require('child_process');
5 | import * as fs from 'fs';
6 |
7 | export function knit(myChannel: vscode.OutputChannel){
8 |
9 | let build = vscode.commands.registerTextEditorCommand('vscode-zen-knit.build', async () => {
10 |
11 | if (vscode.window.activeTextEditor) {
12 | const currentDocument = vscode.window.activeTextEditor.document;
13 | const knit = await getCommand('knit');
14 | var output = getOutput('output');
15 | let { dir: parentDir } = path.parse(currentDocument.uri.path);
16 | if (output === undefined){
17 | output = parentDir.toString()
18 | }
19 | const d = new Date();
20 |
21 | myChannel.appendLine("processing: "+ currentDocument.uri.fsPath + " at: " + d.toISOString());
22 | cp.exec(knit + ' -f ' + currentDocument.uri.fsPath + " -ofd " + output, (error, stdout, stderr) => {
23 | myChannel.appendLine(stdout);
24 | myChannel.appendLine(stderr);
25 | if (error) {
26 | myChannel.appendLine(error.message);
27 |
28 | vscode.window.showErrorMessage("zen-knit : an error ocurred while building file");
29 | return;
30 | }
31 | vscode.window.showInformationMessage("zen-knit : outputfile is build at " + output);
32 | });
33 | }
34 | })
35 | return build
36 | }
37 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/extension.ts:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | import * as vscode from 'vscode';
3 | import { formatDoc } from './core/format';
4 | import { createchannel } from './core/knit_channel';
5 | import { knit } from './core/publish';
6 |
7 |
8 | export function activate(context: vscode.ExtensionContext) {
9 |
10 | const mychannel = createchannel()
11 | mychannel.appendLine('vscode-zen-knit" is now active!')
12 |
13 | // // vscode.window.showInformationMessage('Zen Knit extension is activated');
14 | // let disposable = vscode.commands.registerCommand('vscode-zen-knit.helloWorld', () => {
15 | // vscode.window.showInformationMessage('Hello World from vscode-zen-knit!');
16 | // });
17 |
18 | context.subscriptions.push(knit(mychannel));
19 |
20 | context.subscriptions.push(formatDoc(mychannel));
21 | }
22 |
23 | // this method is called when your extension is deactivated
24 | export function deactivate() {}
25 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/test/runTest.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 |
3 | import { runTests } from '@vscode/test-electron';
4 |
5 | async function main() {
6 | try {
7 | // The folder containing the Extension Manifest package.json
8 | // Passed to `--extensionDevelopmentPath`
9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10 |
11 | // The path to test runner
12 | // Passed to --extensionTestsPath
13 | const extensionTestsPath = path.resolve(__dirname, './suite/index');
14 |
15 | // Download VS Code, unzip it and run the integration test
16 | await runTests({ extensionDevelopmentPath, extensionTestsPath });
17 | } catch (err) {
18 | console.error('Failed to run tests');
19 | process.exit(1);
20 | }
21 | }
22 |
23 | main();
24 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/test/suite/extension.test.ts:
--------------------------------------------------------------------------------
1 | import * as assert from 'assert';
2 |
3 | // You can import and use all API from the 'vscode' module
4 | // as well as import your extension to test it
5 | import * as vscode from 'vscode';
6 | // import * as myExtension from '../../extension';
7 |
8 | suite('Extension Test Suite', () => {
9 | vscode.window.showInformationMessage('Start all tests.');
10 |
11 | test('Sample test', () => {
12 | assert.strictEqual(-1, [1, 2, 3].indexOf(5));
13 | assert.strictEqual(-1, [1, 2, 3].indexOf(0));
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/src/test/suite/index.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 | import * as Mocha from 'mocha';
3 | import * as glob from 'glob';
4 |
5 | export function run(): Promise {
6 | // Create the mocha test
7 | const mocha = new Mocha({
8 | ui: 'tdd',
9 | color: true
10 | });
11 |
12 | const testsRoot = path.resolve(__dirname, '..');
13 |
14 | return new Promise((c, e) => {
15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
16 | if (err) {
17 | return e(err);
18 | }
19 |
20 | // Add files to the test suite
21 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
22 |
23 | try {
24 | // Run the mocha test
25 | mocha.run(failures => {
26 | if (failures > 0) {
27 | e(new Error(`${failures} tests failed.`));
28 | } else {
29 | c();
30 | }
31 | });
32 | } catch (err) {
33 | console.error(err);
34 | e(err);
35 | }
36 | });
37 | });
38 | }
39 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "ES2020",
5 | "lib": [
6 | "ES2020"
7 | ],
8 | "sourceMap": true,
9 | "rootDir": "src",
10 | "strict": true /* enable all strict type-checking options */
11 | /* Additional Checks */
12 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
13 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
14 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
15 | },
16 | "exclude": [
17 | "node_modules",
18 | ".vscode-test"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/vsc-extension-quickstart.md:
--------------------------------------------------------------------------------
1 | # Welcome to your VS Code Extension
2 |
3 | ## What's in the folder
4 |
5 | * This folder contains all of the files necessary for your extension.
6 | * `package.json` - this is the manifest file in which you declare your extension and command.
7 | * The sample plugin registers a command and defines its title and command name. With this information VS Code can show the command in the command palette. It doesn’t yet need to load the plugin.
8 | * `src/extension.ts` - this is the main file where you will provide the implementation of your command.
9 | * The file exports one function, `activate`, which is called the very first time your extension is activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`.
10 | * We pass the function containing the implementation of the command as the second parameter to `registerCommand`.
11 |
12 | ## Setup
13 |
14 | * install the recommended extensions (amodio.tsl-problem-matcher and dbaeumer.vscode-eslint)
15 |
16 |
17 | ## Get up and running straight away
18 |
19 | * Press `F5` to open a new window with your extension loaded.
20 | * Run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World`.
21 | * Set breakpoints in your code inside `src/extension.ts` to debug your extension.
22 | * Find output from your extension in the debug console.
23 |
24 | ## Make changes
25 |
26 | * You can relaunch the extension from the debug toolbar after changing code in `src/extension.ts`.
27 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
28 |
29 |
30 | ## Explore the API
31 |
32 | * You can open the full set of our API when you open the file `node_modules/@types/vscode/index.d.ts`.
33 |
34 | ## Run tests
35 |
36 | * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
37 | * Press `F5` to run the tests in a new window with your extension loaded.
38 | * See the output of the test result in the debug console.
39 | * Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder.
40 | * The provided test runner will only consider files matching the name pattern `**.test.ts`.
41 | * You can create folders inside the `test` folder to structure your tests any way you want.
42 |
43 | ## Go further
44 |
45 | * Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/bundling-extension).
46 | * [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
47 | * Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
48 |
--------------------------------------------------------------------------------
/plugins/vscode-zen-knit/webpack.config.js:
--------------------------------------------------------------------------------
1 | //@ts-check
2 |
3 | 'use strict';
4 |
5 | const path = require('path');
6 |
7 | //@ts-check
8 | /** @typedef {import('webpack').Configuration} WebpackConfig **/
9 |
10 | /** @type WebpackConfig */
11 | const extensionConfig = {
12 | target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
13 | mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
14 |
15 | entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
16 | output: {
17 | // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
18 | path: path.resolve(__dirname, 'dist'),
19 | filename: 'extension.js',
20 | libraryTarget: 'commonjs2'
21 | },
22 | externals: {
23 | vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
24 | // modules added here also need to be added in the .vscodeignore file
25 | },
26 | resolve: {
27 | // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
28 | extensions: ['.ts', '.js']
29 | },
30 | module: {
31 | rules: [
32 | {
33 | test: /\.ts$/,
34 | exclude: /node_modules/,
35 | use: [
36 | {
37 | loader: 'ts-loader'
38 | }
39 | ]
40 | }
41 | ]
42 | },
43 | devtool: 'nosources-source-map',
44 | infrastructureLogging: {
45 | level: "log", // enables logging required for problem matchers
46 | },
47 | };
48 | module.exports = [ extensionConfig ];
--------------------------------------------------------------------------------
/publish.sh:
--------------------------------------------------------------------------------
1 | poetry publish --build --username $USERNAME --password $PASSWORD
2 | # git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "zen_knit"
3 | version = "0.2.5"
4 | description = "Zen-Knit is a formal (PDF), informal (HTML) report generator for data analyst and data scientist who wants to use python. Rmarkdown Alternative for Python, It also allow you to publish reports to Zen Reportz Enterprise or community edition"
5 | authors = ["Zen "]
6 | license = "MIT"
7 | readme = "README.md"
8 | homepage = "https://github.com/Zen-Reportz/zen_knit"
9 | repository = "https://github.com/Zen-Reportz/zen_knit"
10 | include = [
11 | "LICENSE",
12 | ]
13 |
14 |
15 | [tool.poetry.dependencies]
16 | python = ">=3.7,<4.0"
17 | ipython = ">=7.0"
18 | pydantic = "^1.8.2"
19 | jupyter-client = "^7.1.0"
20 | click = "^8.0.3"
21 | nbformat = "^5.1.3"
22 | nbconvert = ">=6.0.0"
23 | Markdown = "^3.3.6"
24 | ipykernel = ">=6.0.0"
25 | SQLAlchemy = "^1.4.29"
26 | joblib = "^1.1.0"
27 | oyaml = "^1.0"
28 | requests = "^2.27.1"
29 |
30 |
31 |
32 | [tool.poetry.scripts]
33 | knit = "zen_knit.cli:knit"
34 | zen = "zen_knit.publish_cli:cli"
35 |
36 | [tool.poetry.dev-dependencies]
37 | pytest = "^5.2"
38 | docutils = "^0.18.1"
39 | pandas = ">1.0.0"
40 | twine = "^3.7.1"
41 | plotly = "^5.5.0"
42 | bokeh = "^2.4.2"
43 | matplotlib = "^3.5.1"
44 | autopep8 = "^1.6.0"
45 | notebook = "^6.4.10"
46 |
47 | [build-system]
48 | requires = ["poetry-core @ git+https://github.com/python-poetry/poetry-core.git@master"]
49 | build-backend = "poetry.core.masonry.api"
--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/tests/__init__.py
--------------------------------------------------------------------------------
/tests/test_zen_knit.py:
--------------------------------------------------------------------------------
1 | from zen_knit import __version__
2 |
3 |
4 | def test_version():
5 | assert __version__ == '0.1.9'
6 |
--------------------------------------------------------------------------------
/zen_knit/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = '0.1.0'
--------------------------------------------------------------------------------
/zen_knit/cli.py:
--------------------------------------------------------------------------------
1 | import os
2 | import click
3 |
4 | from zen_knit.executor import BaseExecutor
5 | from zen_knit.formattor import get_formatter
6 | from zen_knit.formattor.base_formatter import BaseFormatter
7 | from zen_knit.organizer import BaseOrganizer
8 | from zen_knit.parser import PyzParser, PyParser
9 | from zen_knit.reader import BaseReader
10 |
11 | @click.command()
12 | @click.option("-f", '--file', help='Pyz file name with path or file name for current dirctory', required=True)
13 | @click.option("-ofd", '--output_file_dir', help='where output you want to put it, if not provided, current working directory will be used')
14 | def knit(file, output_file_dir):
15 | if output_file_dir is None:
16 | output_file_dir = os.getcwd()
17 |
18 | output_file_dir = os.path.abspath(output_file_dir)
19 | file = os.path.abspath(file)
20 |
21 | br = BaseReader(file, output_file_dir)
22 | if br.raw_data.global_options.input.extension == "pyz":
23 | bp = PyzParser(br.raw_data)
24 | else:
25 | bp = PyParser(br.raw_data)
26 |
27 | be = BaseExecutor(bp.parsed_data)
28 | bo = BaseOrganizer(be.excuted_data)
29 | f = get_formatter(bo.organized_data.global_options.output.format)
30 | bf:BaseFormatter # or its derivative class
31 | bf = f(bo.organized_data)
32 | bf.run()
--------------------------------------------------------------------------------
/zen_knit/data_types/__init__.py:
--------------------------------------------------------------------------------
1 |
2 | import enum
3 | from pydantic import BaseModel, validator
4 | from typing import List, Optional, Tuple, Any
5 |
6 |
7 | class Input(BaseModel):
8 | dir: Optional[str]
9 | file_name: Optional[str]
10 | extension: Optional[str] = "pyz"
11 | matplot: bool = True
12 |
13 | class latexOuput(BaseModel):
14 | header: Optional[str]
15 | page_size: Optional[str] = 'a4paper'
16 | geometry_parameters: Optional[str] = "text={16.5cm,25.2cm},centering"
17 |
18 | class htmlOutput(BaseModel):
19 | css: str = "bootstrap"
20 |
21 | class Output(BaseModel):
22 | fig_dir: str = "figures"
23 | format: Optional[str]
24 | file_name: Optional[str]
25 | dir: Optional[str]
26 | latex: Optional[latexOuput]
27 | html: Optional[htmlOutput]
28 | cache: Optional[bool] = False
29 |
30 |
31 | class GlobalOption(BaseModel):
32 | title: str
33 | author: Optional[str]
34 | date: Optional[str]
35 | kernal: str = "python3"
36 | log_level: str = "debug"
37 | output: Output
38 | input: Input
39 |
40 | @validator('log_level')
41 | def fix_option_for_log(cls, v:str):
42 | if v.lower() not in ('notset', "debug", 'info', 'warning', 'error', 'critical'):
43 | raise ValueError('must contain a space')
44 | return v.title()
45 |
46 |
47 |
48 | class ChunkOption(BaseModel):
49 | name: Optional[str]
50 | echo: bool = True
51 | render: bool = True
52 | run: bool = True
53 | fig: bool = False
54 | fig_size: Tuple = (6, 4)
55 | fig_dpi: int = 200
56 | fig_caption: Optional[str]
57 | fig_position: Optional[str] = "htpb"
58 | fig_env: Optional[str]
59 | fig_width: Optional[str]
60 | con_string: Optional[str] = "zen_con"
61 |
62 | BOOLENCHUNCKOPTIONS = ['run', 'echo','render', 'fig']
63 |
64 |
65 | class Chunk(BaseModel):
66 | type: str
67 | string_: str
68 | options: Optional[ChunkOption]
69 |
70 |
71 | class ParseData(BaseModel):
72 | global_options: Optional[GlobalOption]
73 | chunks: List[Chunk]
74 |
75 | class ReadData(BaseModel):
76 | global_options: Optional[GlobalOption]
77 | data: str
78 |
79 |
80 | class ExecuatedChucnkOut(BaseModel):
81 | output_type: str
82 | data: dict
83 |
84 | class ExecuatedChunk(BaseModel):
85 | chunk: Chunk
86 | results: List[ExecuatedChucnkOut]
87 |
88 | class ExecutedData(BaseModel):
89 | global_options: Optional[GlobalOption]
90 | chunks: List[ExecuatedChunk]
91 |
92 |
93 | class OrganizedChunk(BaseModel):
94 | type: str
95 | str_data: str = ""
96 | complex_data: dict = {}
97 |
98 |
99 | class OrganizedData(BaseModel):
100 | global_options: Optional[GlobalOption]
101 | chunks: List[OrganizedChunk]
102 |
103 | class OrganizedChuckType(enum.Enum):
104 | Markdown = "markdown"
105 | Code = "code"
106 | Result = "se_data"
107 | Table = "e_data"
108 | HTML = "html_data"
109 | Plot = "plot"
110 |
--------------------------------------------------------------------------------
/zen_knit/formattor/__init__.py:
--------------------------------------------------------------------------------
1 | from zen_knit.formattor.base_formatter import BaseFormatter
2 | from zen_knit.formattor.html_formatter import HTMLFormatter
3 | from zen_knit.formattor.markdown_formtter import MarkDownFormatter
4 | from zen_knit.formattor.tex_formatter import TexFormatter
5 |
6 | mime_extensions = {"image/png" : "png",
7 | "image/jpg" : "jpg"}
8 |
9 |
10 | my_formatter = {"pdf": TexFormatter,
11 | "html": HTMLFormatter,
12 | "markdown":MarkDownFormatter}
13 |
14 |
15 | def get_formatter(output) -> BaseFormatter:
16 | return my_formatter[output]
--------------------------------------------------------------------------------
/zen_knit/formattor/base_formatter.py:
--------------------------------------------------------------------------------
1 | import io
2 | from zen_knit.data_types import OrganizedData, GlobalOption, OrganizedChunk
3 |
4 |
5 |
6 | class BaseFormatter:
7 | def __init__(self, organized_data: OrganizedData):
8 | self.organized_data = organized_data
9 | self.formatted_doc = ""
10 | self.header = ""
11 | self.footer = ""
12 | self.subheader = ""
13 |
14 |
15 | def run(self):
16 | self._parsetitle(self.organized_data.global_options)
17 | self._format_doc()
18 | self._build_doc()
19 | file_ = self.write_file()
20 | self._post_process(file_)
21 |
22 |
23 | def _parsetitle(self, global_option:GlobalOption):
24 | pass
25 |
26 | def _format_docchunk(self, content:OrganizedChunk):
27 | pass
28 |
29 | def _format_codechunks(self, content:OrganizedChunk):
30 | pass
31 |
32 | def _format_sqlchunks(self, content: OrganizedChunk):
33 | pass
34 |
35 | def _format_image(self, content:OrganizedChunk):
36 | pass
37 |
38 | def _format_html(self, content:OrganizedChunk):
39 | pass
40 |
41 | def _build_doc(self):
42 | pass
43 |
44 | def _format_doc(self):
45 | chunk: OrganizedChunk
46 | for _, chunk in enumerate(self.organized_data.chunks):
47 | if chunk.type == "markdown":
48 | t = self._format_docchunk(chunk)
49 | self.formatted_doc = self.formatted_doc + "\n" + t
50 | elif chunk.type == "code":
51 | t = self._format_codechunks(chunk)
52 | self.formatted_doc = self.formatted_doc + "\n" + t
53 | elif chunk.type == "sql":
54 | t = self._format_sqlchunks(chunk)
55 | self.formatted_doc = self.formatted_doc + "\n" + t
56 | elif chunk.type == "se_data":
57 | t = self._format_codechunks(chunk)
58 | self.formatted_doc = self.formatted_doc + "\n" + t
59 | elif chunk.type == "e_data":
60 | t = self._format_docchunk(chunk)
61 | self.formatted_doc = self.formatted_doc + "\n" + t
62 | elif chunk.type == "plot":
63 | t = self._format_image(chunk)
64 | self.formatted_doc = self.formatted_doc + "\n" + t
65 | elif chunk.type == "html_data":
66 | t = self._format_html(chunk)
67 | self.formatted_doc = self.formatted_doc + "\n" + t
68 | else:
69 | print("Not right format")
70 |
71 | def write_file(self):
72 | fd = self.organized_data.global_options.output.dir
73 | fn = self.organized_data.global_options.output.file_name
74 | file_ = f"{fd}/{fn}"
75 | print(f"writing file {file_}")
76 | with io.open(file_, 'wt', encoding='utf-8') as f:
77 | f.write(self.formatted_doc)
78 |
79 | def _post_process(self, file_):
80 | pass
81 | # markdown_file = self.executed_data.global_options.input_file_name.split(".")[0] + ".md"
82 | # markdown_file = os.path.join(self.executed_data.global_options.output_file_dir , markdown_file)
83 | # with open(markdown_file, "w") as f:
84 | # text = "\n".join(self.formatted_doc)
85 | # f.write(text)
86 |
--------------------------------------------------------------------------------
/zen_knit/formattor/html_support/__init__.py:
--------------------------------------------------------------------------------
1 | from zen_knit.formattor.html_support import bootstrap
2 | from zen_knit.formattor.html_support import cerulean
3 | from zen_knit.formattor.html_support import skleton
4 | from zen_knit.formattor.html_support import journal
5 | themes = {
6 | "bootstrap": bootstrap.css,
7 | "cerulean": cerulean.css,
8 | "skleton": skleton.css,
9 | "journal": journal.css
10 |
11 | }
12 |
13 | htmltemplate = {}
14 |
15 | htmltemplate["header"] = \
16 | """
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
31 |
32 |
35 |
36 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | """
95 |
96 |
97 |
98 | htmltemplate["footer"]="""
99 |
100 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | """
111 |
--------------------------------------------------------------------------------
/zen_knit/formattor/makrdown_math.py:
--------------------------------------------------------------------------------
1 | import markdown
2 |
3 |
4 | class MathPattern(markdown.inlinepatterns.Pattern):
5 | def __init__(self):
6 | markdown.inlinepatterns.Pattern.__init__(self, r'(? 0 :
73 | workerNames = ', '.join(response["workers"])
74 | print(f"following worker(s) are not present, please talk your admin {workerNames}")
75 |
76 | if len(response["worker_groups"])> 0 :
77 | worker_group = ', '.join(response["worker_groups"])
78 | print(f"following worker group(s) are not present, please talk your admin {worker_group}")
79 |
80 | url_to_open = publish_url + f'report-application/{report_id}?type={type}&open=true'
81 |
82 | if browser:
83 | webbrowser.open(url_to_open)
84 |
85 | os.chdir(old_path)
86 |
87 | return "publish report"
88 |
--------------------------------------------------------------------------------
/zen_knit/publish/core/worker.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | from click import UsageError
4 |
5 | from zen_knit.publish.support import cred
6 |
7 | def get_workers(profile):
8 |
9 | access_key, secret_key , publish_url = cred.pull_cred(profile)
10 |
11 | data = {}
12 | data['access_key'] = access_key
13 | data['secret_key'] = secret_key
14 |
15 | r = requests.post( f"{publish_url}api/external/get_worker/", data=data)
16 | if r.status_code != 200:
17 | raise UsageError(r.text)
18 | else:
19 | response = r.json()
20 |
21 | if response["data"] is None :
22 | print("no worker name present")
23 | return 0
24 |
25 | workerNames = ', '.join( d["name"] for d in response["data"])
26 | print(f" workers are {workerNames}")
27 | return 0
28 |
29 |
30 | def get_worker_groups(profile):
31 | access_key, secret_key , publish_url = cred.pull_cred(profile)
32 |
33 | data = {}
34 | data['access_key'] = access_key
35 | data['secret_key'] = secret_key
36 |
37 | r = requests.post( f"{publish_url}api/external/get_worker_group/", data=data)
38 | if r.status_code != 200:
39 | raise UsageError(r.text)
40 | else:
41 | response = r.json()
42 | if response["data"] is None :
43 | print("no worker group name present")
44 |
45 | return 0
46 | workerGroupNames = ', '.join( d["name"] for d in response["data"])
47 | print(f" worker group are {workerGroupNames}")
48 | return 0
49 |
--------------------------------------------------------------------------------
/zen_knit/publish/support/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Zen-Reportz/zen_knit/104c2693d2cc61520657131da769f5d59d2df8e9/zen_knit/publish/support/__init__.py
--------------------------------------------------------------------------------
/zen_knit/publish/support/cred.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | import oyaml as yaml
4 |
5 | from click import UsageError
6 | import pathlib
7 |
8 | def cred_path()-> str:
9 | base_path = os.path.expanduser("~")
10 | setting_path = base_path + "/.zen/setting.yml"
11 | return setting_path
12 |
13 | def cred_file_present():
14 | setting_path = cred_path()
15 |
16 | if not os.path.isfile(setting_path):
17 | raise UsageError("zen report data is not present please use zen create command")
18 |
19 | return setting_path
20 |
21 | def cred_folder():
22 | base_path = os.path.expanduser("~")
23 | folder_path = f"{base_path}/.zen"
24 | if not os.path.isdir(folder_path):
25 | os.mkdir(folder_path)
26 | return folder_path
27 |
28 |
29 | def pull_cred(profile):
30 | cred_folder()
31 |
32 | setting_path = cred_file_present()
33 | with open(setting_path, "r") as f:
34 | data = yaml.safe_load(f)
35 |
36 | if profile not in data.keys():
37 | raise UsageError(f"{profile} is not present in file")
38 |
39 | publish_url = data[profile]['url']
40 | if publish_url[-1] != "/":
41 | publish_url = publish_url + "/"
42 | access_key = data[profile]["key"]
43 | secret_key = data[profile]["secret"]
44 |
45 | return access_key, secret_key, publish_url
46 |
47 |
48 | def create(key, secret, url, profile):
49 | folder_path = cred_folder()
50 | setting_path = cred_path()
51 |
52 | p = pathlib.Path(folder_path)
53 | p.mkdir(parents=True, exist_ok=True)
54 |
55 | if not os.path.exists(setting_path):
56 | my_dict = {
57 | profile: {
58 | "key": key,
59 | "secret": secret,
60 | "url": url
61 | }
62 | }
63 | else:
64 |
65 | with open(setting_path, "r") as f:
66 | my_dict = yaml.safe_load(f)
67 |
68 | my_dict[profile] = {
69 | "key": key,
70 | "secret": secret,
71 | "url": url
72 | }
73 | with open(setting_path, "w") as f:
74 | yaml.safe_dump(my_dict, f)
75 |
76 | return "created value"
77 |
78 |
79 | def update(key, secret, profile):
80 | cred_folder()
81 | setting_path = cred_file_present()
82 |
83 | with open(setting_path, "r") as f:
84 | data = yaml.safe_load(f)
85 |
86 | if profile not in data.keys():
87 | raise UsageError(f"{profile} is not present in file")
88 |
89 | data[profile]['key'] = key
90 | data[profile]['secret'] = secret
91 |
92 | with open(setting_path, "w") as f:
93 | yaml.dump(data, f)
94 |
95 | return "updated value"
--------------------------------------------------------------------------------
/zen_knit/publish_cli.py:
--------------------------------------------------------------------------------
1 | import click
2 | import os
3 |
4 | from zen_knit.publish.support import cred
5 | from zen_knit.publish.core import publish as my_publish, worker
6 |
7 |
8 |
9 |
10 | @click.group()
11 | def cli():
12 | pass
13 |
14 |
15 | @click.command()
16 | @click.option('--key', prompt='what is your key?', help='What is your access key?')
17 | @click.option('--secret', prompt='what is your secret key?', help='What is your secret key?')
18 | @click.option('--url', prompt='what is zen report url?', help='what is zen report url?')
19 | @click.option('--profile', help='which profile do you want to use?', default='default')
20 | def create(key, secret, url, profile):
21 | return cred.create(key, secret, url, profile)
22 |
23 |
24 | @click.command()
25 | @click.option('--key', help='What is your access key?')
26 | @click.option('--secret', help='What is your secret key?')
27 | @click.option('--url', help='what is zen report url?')
28 | @click.option('--profile', help='which profile do you want to use?', default='default')
29 | def create_w(key, secret, url, profile):
30 | return cred.create(key, secret, url, profile)
31 |
32 |
33 | @click.command()
34 | @click.option('--key', prompt='what is your access key?', help='What is your access key?')
35 | @click.option('--secret', prompt='what is your secret key?', help='What is your secret key?')
36 | @click.option('--profile', help='which profile do you want to use?', default='default')
37 | def update(key, secret, profile):
38 | return cred.update(key, secret, profile)
39 |
40 |
41 | @click.command()
42 | @click.option('--key', help='What is your access key?')
43 | @click.option('--secret', help='What is your secret key?')
44 | @click.option('--profile', help='which profile do you want to use?', default='default')
45 | def update_w(key, secret, profile):
46 | return cred.update(key, secret, profile)
47 |
48 | @click.command()
49 | @click.option('--path', prompt='path of report or dashboard?', default=os.getcwd(), help="folder to look into")
50 | @click.option('--fresh', '-f', prompt='do you want to publish as fresh report', is_flag=True, help="run as fresh report")
51 | @click.option('--browser','-b',prompt='do you want to open report in browser', is_flag=True, help="Want to open window")
52 | @click.option('--profile', prompt='which profile do you want to use?', help='which profile do you want to use?', default='default')
53 | def publish(path, fresh, browser, profile):
54 | return my_publish.publish(path, fresh, browser, profile)
55 |
56 |
57 | @click.command()
58 | @click.option('--path', default=os.getcwd(), help="folder to look into")
59 | @click.option('--fresh', '-f', is_flag=True, help="run as fresh report")
60 | @click.option('--browser','-b', is_flag=True, help="Want to open window")
61 | @click.option('--profile', help='which profile do you want to use?', default='default')
62 | def publish_w(path, fresh, browser, profile):
63 | return my_publish.publish_w(path, fresh, browser, profile)
64 |
65 | @click.command()
66 | @click.option('--profile', help='which profile do you want to use?', default='default')
67 | def get_workers(profile):
68 | return worker.get_workers(profile)
69 |
70 | @click.command()
71 | @click.option('--profile', help='which profile do you want to use?', default='default')
72 | def get_worker_group(profile):
73 | return worker.get_worker_groups(profile)
74 |
75 |
76 |
77 | cli.add_command(update)
78 | cli.add_command(update_w)
79 |
80 | cli.add_command(create)
81 | cli.add_command(create_w)
82 |
83 | cli.add_command(publish)
84 | cli.add_command(publish_w)
85 |
86 | cli.add_command(get_workers)
87 | cli.add_command(get_worker_group)
88 |
--------------------------------------------------------------------------------
/zen_knit/reader/__init__.py:
--------------------------------------------------------------------------------
1 | from distutils import extension
2 | import os
3 | from zen_knit.data_types import Input, Output, ReadData, GlobalOption
4 |
5 |
6 | class BaseReader:
7 | def __init__(self, input_file, output_file_dir = None) -> None:
8 | full_path = self._build_input_file(input_file)
9 | input_file_path , input_file_name = self._build_input_file_folder(full_path)
10 | self.raw_data = ReadData(
11 | global_options=GlobalOption(
12 | title = "test",
13 | output = Output(
14 | dir = output_file_dir,
15 | ),
16 | input = Input(
17 | dir = input_file_path,
18 | file_name = input_file_name,
19 | extension= input_file_name.split(".")[-1]
20 | )
21 | ),
22 | data=self._read(full_path)
23 | )
24 |
25 | def _build_input_file(self, input_file):
26 | return os.path.abspath(input_file)
27 |
28 | def _build_input_file_folder(self, full_path):
29 | return os.path.split(full_path)
30 |
31 | def _read(self, full_path):
32 | with open(full_path, "r") as f:
33 | contents = f.read()
34 | return contents
35 |
36 |
--------------------------------------------------------------------------------