Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !21496

Remove duplication in `flexbox.md`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/Starsam80/more-bd into v4-dev Jan 01, 2017
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 2

Created by: Starsam80

First commit removes a lot of duplication by using loops. In fact, I can reduce the duplication even more by using {% cycle %} but then it starts looking like code-golf, so I'm not going to do that.

The second commit just puts the bd-highlight class in front of the p-2 class, so when it parses, it will hide the p-2 class. A lot of this is pointless because it'll get replaced with ... later.

The third commit merges the 2 functions we had before (remove_holderjs and remove_example_classes) and puts it into a new function called cleanup_highlighted_code. The TODO comment was when I realized that regex does not parse HTML and should be replaced by something better. The 2 new features that I've also added in this commit are:

  • The data-bd-hide attribute, which hides the attributes that follow it.
    • <div class="d-flex" data-bd-hide style="height: 100px;"> => <div class="d-flex">
  • The data-bd-remove attribute, which replaces the entire element with ...
    • <div data-bd-remove class="d-flex"> => ...

Please note that these are not going to work 100% of the time, because of the way HTML and regex work.

The fourth commit uses the stuff that I added in the previous commit. I plan to do this to every single file, but I first need to fix the TODO.

For people that want to see what this changes, I've made a build of the docs here: https://bootstrap-tests.starsam80.net/more-bd/utilities/flexbox/

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Starsam80/more-bd