<commit_before>circle = $.sammy("body", ->

  # Page
  class Page
    constructor: (@name, @title) ->

    init: ->
      document.title = "Circle - " + @title

      # Render content
      @render()

      # Land at the right anchor on the page
      @scroll(window.location.hash)

      # Fetch page-specific libraries
      @lib() if @lib?

    render: ->
      $("body").attr("id","#{@name}-page").html HAML['header'](renderContext)
      $("body").append HAML[@name](renderContext)
      $("body").append HAML['footer'](renderContext)

    load: ->
      $.getScript("/assets/views/outer/#{@name}/#{@name}.hamlc", => @init())

    scroll: (hash) ->
      if hash == '' or hash == '#' then hash = "body"
      $('html, body').animate({scrollTop: $(hash).offset().top}, 0)

    display: ->
      if HAML? and HAML[@name]?
        @init()
      else
        @load()

  # Doc
  class Doc extends Page
    render: ->
      if $('.categories').length > 0
        $('.doc-title').remove();
        $('.categories').removeClass('categories').addClass('article');
        $('.article').html(HAML[@name](renderContext));
      else
        $("body").attr("id","#{@name}-page").html(HAML['header'](renderContext))
        $("body").append(HAML['title'](renderContext))
        $("#title h1").text("Documentation")
        $("body").append("<div id='content'><section class='article'></section></div>")
        $(".article").append(HAML[@name](renderContext))
        $("body").append(HAML['footer'](renderContext))

    load: ->
      if !HAML['categories']
        $.getScript("/assets/views/outer/docs/categories.hamlc", => @article())
      else
        @article()

    article: ->
      $.getScript("/assets/views/outer/docs/topics/#{@name}.hamlc", => @init())

  # Pages
  home = new Page("home", "Continuous Integration made easy")
  about = new Page("about", "About Us")
  privacy = new Page("privacy", "Privacy and Security")
  docs = new Page("docs", "Documentation")

  # Docs
  article = new Doc("article", "Sample template for an Article")

  # Per-Page Libs
  highlight = ->
    if !hljs?
      $.getScript("/assets/js/vendor/highlight.pack.js", ->
        $("pre code").each (i, e) -> hljs.highlightBlock e
      )<commit_msg>Show topic sidebar in Docs<commit_after>circle = $.sammy("body", ->

  # Page
  class Page
    constructor: (@name, @title) ->

    init: ->
      document.title = "Circle - " + @title

      # Render content
      @render()

      # Land at the right anchor on the page
      @scroll(window.location.hash)

      # Fetch page-specific libraries
      @lib() if @lib?

    render: ->
      $("body").attr("id","#{@name}-page").html HAML['header'](renderContext)
      $("body").append HAML[@name](renderContext)
      $("body").append HAML['footer'](renderContext)

    load: ->
      $.getScript("/assets/views/outer/#{@name}/#{@name}.hamlc", => @init())

    scroll: (hash) ->
      if hash == '' or hash == '#' then hash = "body"
      $('html, body').animate({scrollTop: $(hash).offset().top}, 0)

    display: ->
      if HAML? and HAML[@name]?
        @init()
      else
        @load()

  # Doc
  class Doc extends Page
    render: ->
      if $('.categories').length > 0
        $('.doc-title').remove();
        $('.categories').removeClass('categories').addClass('article');
        $(".article").html(HAML['categories']).append(HAML[@name](renderContext));
      else
        $("body").attr("id","#{@name}-page").html(HAML['header'](renderContext))
        $("body").append(HAML['title'](renderContext))
        $("#title h1").text("Documentation")
        $("body").append("<div id='content'><section class='article'></section></div>")
        $(".article").append(HAML['categories']).append(HAML[@name](renderContext))
        $("body").append(HAML['footer'](renderContext))

    load: ->
      if !HAML['categories']
        $.getScript("/assets/views/outer/docs/categories.hamlc", => @article())
      else
        @article()

    article: ->
      $.getScript("/assets/views/outer/docs/topics/#{@name}.hamlc", => @init())

  # Pages
  home = new Page("home", "Continuous Integration made easy")
  about = new Page("about", "About Us")
  privacy = new Page("privacy", "Privacy and Security")
  docs = new Page("docs", "Documentation")

  # Docs
  article = new Doc("article", "Sample template for an Article")

  # Per-Page Libs
  highlight = ->
    if !hljs?
      $.getScript("/assets/js/vendor/highlight.pack.js", ->
        $("pre code").each (i, e) -> hljs.highlightBlock e
      )
{'fraction_non_alphanumeric': 0.21080485115766262, 'fraction_numerical': 0.001323042998897464, 'mean_word_length': 2.867007672634271, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573294', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1396, 'n_words': 278}