1-
21//==================================================
32// For the description see
43// [SupeflyCSS Test Task](https://github.com/superfly-css/superfly-css-task-deploy/)
3029// that are used have @font -face declarations generated.
3130// Main and test css is sourced and the result of the task
3231// is output to the corresponding deploy directories.
33- // ---------------------------------------------------
32+ - // ---------------------------------------------------
3433// deploy:html
3534// ---------------------------------------------------
3635// This updates the css import of the corresponding test html
4746//==================================================
4847
4948var gulp = require ( 'gulp' ) ;
49+ var cheerio = require ( 'gulp-cheerio' ) ;
5050var pc = require ( 'gulp-postcss' ) ;
5151var pc_import = require ( 'postcss-import' ) ;
5252var pc_calc = require ( 'postcss-calc' ) ;
@@ -72,28 +72,30 @@ var post_uncss_processors = [pc_font_magician, autoprefixer, pc_reporter({
7272
7373gulp . task ( 'deploy:test:css' , function ( ) {
7474 return gulp . src ( PLI . SRC_TEST_CSS )
75+ . pipe ( pc ( pre_uncss_processors ) )
7576 . pipe ( uncss ( {
76- . pipe ( pc ( pre_uncss_processors ) )
7777 html : [ PLI . TARGET_TEST_HTML ]
7878 } ) )
7979 . pipe ( pc ( post_uncss_processors ) )
8080 . pipe ( gulp . dest ( PLI . deploy . test . css ) ) ;
8181} ) ;
8282
83-
84-
85- var PLI = require ( 'superfly-css-pli' ) ;
86-
87- //---------------------------------
8883gulp . task ( 'deploy:test:html' , function ( ) {
8984 return gulp
9085 . src ( PLI . TARGET_TEST_HTML )
9186 . pipe ( cheerio ( function ( $ , file ) {
92- $ ( 'link[href="href="../../../target/test/css/index.css"]' ) . a ttr ( 'href' ,
93- $ ( 'link[href="href="../../../target/test/css/index.css"]' ) .
94- a ttr ( 'href' ) . replace ( 'target' , 'deploy' ) ) ;
87+ $ ( '.Test_markup > code' ) . each ( function ( ) {
88+ var markup = $ ( this ) . html ( ) ;
89+ //Insert the Test-render block after the Test-then block
90+ //Append the markup block to the Test-render block
91+ $ ( $ ( this ) . parent ( ) . parent ( ) . next ( ) . children ( '.Test_description' ) ) . after ( renderTestBlock ) . next ( ) . append ( markup ) ;
9592 } ) ;
9693 } ) )
94+ /*
95+ $('link[href="href="../../../target/test/css/index.css"]').attr('href',
96+
97+ });*/
98+
9799 . pipe ( gulp . dest ( PLI . deploy . test . html ) ) ;
98100} ) ;
99101
0 commit comments