Code Folding

This page uses the basic format developed in the Code_Mockups page, then adds support for code folding:

Code folding is a feature of some text editors, source code editors, and IDEs that allows the user to selectively hide and display - "fold" - sections of a currently-edited file as a part of routine edit operations. This allows the user to manage large amounts of text while viewing only those subsections of the text that are specifically relevant at any given time.

Approaches

There are at least two plausible approaches to doing code folding in HTML. The ones we're currently experimenting with use:

ARIA attributes

Nested DIV tags

This approach uses a div tag for each level of indentation and br tags to force line breaks:

#####
def parse_args(argv) do
parse = OptionParser.parse(argv, switches: [help: :boolean], aliases: [h: :help ])
case parse do
{ [ help: true ], _, _ } -> :help
{ _, [ user, project, count ], _ } -> { user, project, String.to_integer(count) }
{ _, [ user, project ], _ } -> { user, project, @default_count }
_ -> :help
end
end
#####

Nested UL and LI tags

This approach uses a ul tag for each level of indentation and li tags to force line breaks:

  • def parse_args(argv) do
    • parse = OptionParser.parse(argv, switches: [help: :boolean], aliases: [h: :help ])
    • case parse do
      • { [ help: true ], _, _ } -> :help
      • { _, [ user, project, count ], _ } -> { user, project, String.to_integer(count) }
      • { _, [ user, project ], _ } -> {user, project, @default_count }
      • _ -> :help
    • end
  • end


This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r4 - 06 Aug 2016, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email