Browse Source

Merge branch 'develop' into develop

Dustin Utecht 4 years ago
parent
commit
0c39746d10

+ 1 - 1
site/_includes/stylesheet.html

@@ -7,6 +7,6 @@
 {% endif %}
 {% if page.layout != "examples" %}
 <link href="{{ site.baseurl }}/assets/css/docs.min.css" rel="stylesheet">
-<link href="{{ site.baseurl }}/assets/css/style.css?m=8" rel="stylesheet">
+<link href="{{ site.baseurl }}/assets/css/style.css?m=9" rel="stylesheet">
 {% endif %}
 {%- endif -%}

+ 14 - 1
site/_layouts/docs.html

@@ -21,7 +21,20 @@
         {% endif %}
 
         <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content {{ page.group }}" role="main">
-          <h1 class="bd-title" id="content">{{ page.title | smartify }}</h1>
+          <div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
+            <a class="btn btn-sm btn-bd-light mb-2 mb-md-0"
+              {% if page.group == 'faq' or page.group == 'online-editor' %}
+              href="{{ site.repo }}/blob/develop/site/docs/{{ page.name }}"
+              {% else %}
+              href="{{ site.repo }}/blob/develop/site/docs/{{ page.group }}/{{ page.name }}"
+              {% endif %}
+              title="View and edit this file on GitHub" target="_blank" rel="noopener">
+              View on GitHub
+            </a>
+            <h1 class="bd-title" id="content">
+              {{ page.title | smartify }}
+            </h1>
+          </div>
           <p class="bd-lead">{{ page.description | smartify }}</p>
           {% include ads.html %}
           {{ content }}

+ 5 - 0
site/assets/css/style.css

@@ -1,3 +1,8 @@
+.btn-bd-light {
+  color: #6c757d;
+  border-color: #dee2e6;
+}
+
 .api h2 {
   margin-top: 4rem !important;
   margin-bottom: 2rem;

+ 3 - 3
site/docs/api/table-options.md

@@ -1296,7 +1296,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 ## showButtonIcons
 
-- **Attribute:** `show-button-icons`
+- **Attribute:** `data-show-button-icons`
 
 - **Type:** `Boolean`
 
@@ -1310,7 +1310,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 ## showButtonText
 
-- **Attribute:** `show-button-text`
+- **Attribute:** `data-show-button-text`
 
 - **Type:** `Boolean`
 
@@ -1842,7 +1842,7 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 ## visibleSearch
 
-- **Attribute:** `visible-search`
+- **Attribute:** `data-visible-search`
 
 - **Type:** `Boolean`
 

+ 10 - 0
tools/check-api.js

@@ -7,6 +7,7 @@ let errorSum = 0
 const exampleFilesFolder = './bootstrap-table-examples/'
 const exampleFilesFound = fs.existsSync(exampleFilesFolder)
 let exampleFiles = []
+
 if (exampleFilesFound) {
   exampleFiles = [
     ...fs.readdirSync(exampleFilesFolder + 'welcomes'),
@@ -38,6 +39,7 @@ class API {
     const outLines = lines.slice(0, 1)
     const errors = []
     const exampleRegex = /\[.*\]\(.*\/(.*\.html)\)/m
+    const attributeRegex = /\*\*Attribute:\*\*\s`(.*)data-(.*)`/m
 
     for (const item of lines.slice(1)) {
       md[item.split('\n')[0]] = item
@@ -52,6 +54,7 @@ class API {
 
           for (let i = 0; i < this.attributes.length; i++) {
             const name = this.attributes[i]
+
             if (this.ignore && this.ignore[key] && this.ignore[key].includes(name)) {
               continue
             }
@@ -67,6 +70,13 @@ class API {
               if (!exampleFiles.includes(matches[1])) {
                 errors.push(chalk.red(`[${key}] example '${matches[1]}' could not be found`))
               }
+            } else if (name === 'Attribute' && key !== 'columns') {
+              const attributeMatches = attributeRegex.exec(tmpDetails)
+
+              if (!attributeMatches) {
+                errors.push(chalk.red(`[${key}] missing or wrong formatted attribute`, `"${tmpDetails}"`))
+                continue
+              }
             }
 
             if (!tmpDetails || tmpDetails.indexOf(`**${name}:**`) === -1) {