Do nothing by default but subclasses should put all their specific templating code in this method to regroup and simplify their logic
Note: to avoid inconsistencies, the template is automatically frozen
(see freeze
) after the invocation of rendering
.
# Service used to render the content of the template.
#
# Do nothing by default but subclasses should put all their specific
# templating code in this method to regroup and simplify their logic
#
# Note: to avoid inconsistencies, the template is automatically frozen
# (see `freeze`) after the invocation of `rendering`.
protected fun rendering do end
lib/template/template.nit:88,2--95,31
redef fun rendering
do
var header = header
if header != null then add header
var name = name
if annotations.is_empty then
add "module {name}\n\n"
else
add "module {name} is\n"
for annotation in annotations do add "\t{annotation}\n"
add "end\n\n"
end
for i in imports do
if i.to_s.has("import ") then
add i
else
add "import "
add i
end
add "\n"
end
add "\n"
for l in content do
add l
add "\n"
end
end
lib/gen_nit/gen_nit.nit:68,2--97,4
redef fun rendering
do
var code_message = http_status_codes[code]
var message
if code_message != null then
message = "Error {code}: {code_message}"
else message = "Error {code}"
add """
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<title>"""
add message
add """
</title>
</head>
<body>"""
var header = header
if header != null then add header
add """
<div class="container">
<h1>"""
add message
add "</h1>"
var body = body
if body != null then add body
add """
</div>
</body>
</html>"""
end
lib/nitcorn/http_errors.nit:37,2--74,4
redef fun rendering do add """
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{{message or else status}}}</title>
</head>
<body>
<h1>{{{status}}} {{{message or else ""}}}</h1>
</body>
</html>"""
lib/popcorn/examples/middlewares/example_html_error_handler.nit:28,2--38,12
redef fun rendering do
add """
COMPOSERS
=========
"""
add_all composers
add """
DETAILS
=======
"""
add_all composer_details
end
lib/template/examples/tmpl_composer.nit:38,2--50,4
redef fun rendering do add """
COMPOSER: {{{firstname}}} {{{lastname}}}
BIRTH...: {{{birth}}}
DEATH...: {{{death}}}
"""
lib/template/examples/tmpl_composer.nit:72,2--77,3
redef fun rendering do
var name = toolcontext.toolname
var option_names = extract_options_names
addn "# generated bash completion file for {name} {toolcontext.version}"
addn "_{name}()"
addn "\{"
addn " local cur prev opts"
addn " COMPREPLY=()"
addn " cur=\"$\{COMP_WORDS[COMP_CWORD]\}\""
addn " prev=\"$\{COMP_WORDS[COMP_CWORD-1]\}\""
if not option_names.is_empty then
addn " opts=\"{option_names.join(" ")}\""
addn " if [[ $\{cur\} == -* ]] ; then"
addn " COMPREPLY=( $(compgen -W \"$\{opts\}\" -- $\{cur\}) )"
addn " return 0"
addn " fi"
end
addn "\} &&"
addn "complete -o default -F _{name} {name}"
end
src/toolcontext.nit:670,2--689,4
redef fun rendering
do
add header
add "\n"
add "public class {java_class_name} \{\n"
add class_content
add "\}"
end
src/ffi/java.nit:414,2--421,4
redef fun rendering
do
add """
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
"""
# List build files (compilable sources and assets) with their reference UUID
for array in [source_files, asset_files] do for file in array do add """
{{{file.build_uuid}}} /* {{{file.doc}}} */ = {
isa = PBXBuildFile;
fileRef = {{{file.ref_uuid}}} /* {{{file.doc}}} */;
};
"""
add """
0F4688411FDF8748004F34D4 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 0F4688401FDF8748004F34D4 /* assets */; };
0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
/* Static generated files */
AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */ = {
isa = PBXFileReference;
explicitFileType = wrapper.application;
includeInIndex = 0;
path = {{{name}}}.app;
sourceTree = BUILT_PRODUCTS_DIR;
};
AF9F83D01A5F0D21004B62C0 /* Info.plist */ = {
isa = PBXFileReference;
lastKnownFileType = text.plist.xml;
path = Info.plist;
sourceTree = "<group>";
};
AF9F83DE1A5F0D21004B62C0 /* Base */ = {
isa = PBXFileReference;
lastKnownFileType = file.storyboard;
name = Base;
path = Base.lproj/Main.storyboard;
sourceTree = "<group>";
};
AF9F83E01A5F0D21004B62C0 /* Images.xcassets */ = {
isa = PBXFileReference;
lastKnownFileType = folder.assetcatalog;
path = Images.xcassets;
sourceTree = "<group>";
};
AF9F83E31A5F0D21004B62C0 /* Base */ = {
isa = PBXFileReference;
lastKnownFileType = file.xib;
name = Base;
path = Base.lproj/LaunchScreen.xib;
sourceTree = "<group>";
};
/* Changing generated files */
"""
# Describe all known files
for file in files do add file.description
add """
0F4688401FDF8748004F34D4 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = {{{name}}}/assets; sourceTree = SOURCE_ROOT; };
0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
AF9F83C91A5F0D21004B62C0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
AF9F83C31A5F0D21004B62C0 = {
isa = PBXGroup;
children = (
AF9F83CE1A5F0D21004B62C0 /* {{{name}}} */,
AF9F83CD1A5F0D21004B62C0 /* Products */,
0FDD07A11C6F8E0E006FF70E /* LaunchScreen.storyboard */,
);
sourceTree = "<group>";
};
AF9F83CD1A5F0D21004B62C0 /* Products */ = {
isa = PBXGroup;
children = (
AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */,
);
name = Products;
sourceTree = "<group>";
};
AF9F83CE1A5F0D21004B62C0 /* {{{name}}} */ = {
isa = PBXGroup;
children = (
0F4688401FDF8748004F34D4 /* assets */,
"""
# Reference all known files
for file in files do add """
{{{file.ref_uuid}}} /* {{{file.doc}}} */,
"""
add """
);
path = {{{name}}};
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
AF9F83CB1A5F0D21004B62C0 /* {{{name}}} */ = {
isa = PBXNativeTarget;
buildConfigurationList = AF9F83F31A5F0D21004B62C0 /* Build configuration list for PBXNativeTarget "{{{name}}}" */;
buildPhases = (
AF9F83C81A5F0D21004B62C0 /* Sources */,
AF9F83C91A5F0D21004B62C0 /* Frameworks */,
AF9F83CA1A5F0D21004B62C0 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = {{{name}}};
productName = {{{name}}};
productReference = AF9F83CC1A5F0D21004B62C0 /* {{{name}}}.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
AF9F83C41A5F0D21004B62C0 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
TargetAttributes = {
AF9F83CB1A5F0D21004B62C0 = {
CreatedOnToolsVersion = 6.1.1;
};
};
};
buildConfigurationList = AF9F83C71A5F0D21004B62C0 /* Build configuration list for PBXProject "{{{name}}}" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = AF9F83C31A5F0D21004B62C0;
productRefGroup = AF9F83CD1A5F0D21004B62C0 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
AF9F83CB1A5F0D21004B62C0 /* {{{name}}} */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
AF9F83CA1A5F0D21004B62C0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
"""
# Reference all asset files by their build UUID
for file in asset_files do add """
{{{file.build_uuid}}} /* {{{file.doc}}} */,
"""
add """
0FDD07A21C6F8E0E006FF70E /* LaunchScreen.storyboard in Resources */,
0F4688411FDF8748004F34D4 /* assets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
AF9F83C81A5F0D21004B62C0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
"""
# Reference all compilable source files by their build UUID
for file in source_files do add """
{{{file.build_uuid}}} /* {{{file.doc}}} */,
"""
add """
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
AF9F83F11A5F0D21004B62C0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
AF9F83F21A5F0D21004B62C0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
AF9F83F41A5F0D21004B62C0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = {{{name}}}/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_CFLAGS = "{{{cflags.escape_to_c}}}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
AF9F83F51A5F0D21004B62C0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = {{{name}}}/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_CFLAGS = "{{{cflags.escape_to_c}}}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
AF9F83C71A5F0D21004B62C0 /* Build configuration list for PBXProject "{{{name}}}" */ = {
isa = XCConfigurationList;
buildConfigurations = (
AF9F83F11A5F0D21004B62C0 /* Debug */,
AF9F83F21A5F0D21004B62C0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
AF9F83F31A5F0D21004B62C0 /* Build configuration list for PBXNativeTarget "{{{name}}}" */ = {
isa = XCConfigurationList;
buildConfigurations = (
AF9F83F41A5F0D21004B62C0 /* Debug */,
AF9F83F51A5F0D21004B62C0 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = AF9F83C41A5F0D21004B62C0 /* Project object */;
}
"""
end
src/platform/xcode_templates.nit:167,2--475,4
redef fun rendering
do
add """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>{{{bundle_identifier}}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>{{{product_name}}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>{{{short_version}}}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>{{{bundle_version}}}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
</dict>
</plist>
"""
end
src/platform/xcode_templates.nit:494,2--549,4
redef fun rendering
do
add """
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="{{{subtitle}}}" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="559" width="560" height="21"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="{{{title}}}" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="20" y="176" width="560" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.5" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>"""
end
src/platform/xcode_templates.nit:565,2--618,4
redef fun rendering
do
add """
</div> <!-- container-fluid -->
<script src='https://code.jquery.com/jquery-latest.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table-all.min.js'></script>
"""
add_piwik
add """
</body>
</html>
"""
end
src/nitcatalog.nit:118,2--132,4
# Render the whole page
redef fun rendering do
render_head
add topmenu
addn "<div class='container-fluid'>"
render_content
addn "</div>"
render_footer
end
src/doc/static/static_html.nit:141,2--149,4
redef fun rendering do
var has_left = show_sidebar and sidebar.cards.not_empty
var has_right = metadata.cards.not_empty
addn "<div class='tab-pane {if is_active then "active" else ""}' id='{id}'>"
if has_left then
addn " <div class='col-sm-3'>"
addn sidebar
addn " </div>"
end
var cols = 12
if has_left then cols -= 3
if has_right then cols -= 3
addn " <div class='col-sm-{cols}'>"
for card in content do addn card
addn " </div>"
if has_right then
addn " <div class='col-sm-3'>"
addn metadata
addn " </div>"
end
addn "</div>"
end
src/doc/static/static_html.nit:227,2--249,4
redef fun rendering do
addn "<script>"
var site_id = self.site_id.to_json
var tracker_url = self.tracker_url.trim
if tracker_url.chars.last != '/' then tracker_url += "/"
tracker_url = "://{tracker_url}".to_json
addn "<!-- Piwik -->"
addn "var _paq = _paq || [];"
addn " _paq.push([\"trackPageView\"]);"
addn " _paq.push([\"enableLinkTracking\"]);"
addn "(function() \{"
addn " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + {tracker_url};"
addn " _paq.push([\"setTrackerUrl\", u+\"piwik.php\"]);"
addn " _paq.push([\"setSiteId\", {site_id}]);"
addn " var d=document, g=d.createElement(\"script\"), s=d.getElementsByTagName(\"script\")[0]; g.type=\"text/javascript\";"
addn " g.defer=true; g.async=true; g.src=u+\"piwik.js\"; s.parentNode.insertBefore(g,s);"
addn "\})();"
addn "</script>"
end
src/doc/static/static_html.nit:340,2--361,4
redef fun rendering do
add "<span{render_css_classes} aria-hidden=\"true\"></span>"
end
lib/html/bootstrap.nit:229,2--231,4
redef fun rendering do
addn "<div{render_css_classes}>"
if is_dismissible then
add "<button type=\"button\" class=\"close\" data-dismiss=\"alert\""
add "aria-label=\"Close\"><span aria-hidden=\"true\">×</span>"
addn "</button>"
end
addn text.write_to_string
addn "</div>"
end
lib/html/bootstrap.nit:383,2--392,4
redef fun rendering do
addn "<div{render_css_classes}>"
var heading = self.heading
if heading != null then
addn "<div class=\"panel-heading\">"
addn heading.write_to_string
addn "</div>"
end
var body = self.body
if body != null then
addn "<div class=\"panel-body\">"
addn body.write_to_string
addn "</div>"
end
var footer = self.footer
if footer != null then
addn "<div class=\"panel-footer\">"
addn footer.write_to_string
addn "</div>"
end
addn "</div>"
end
lib/html/bootstrap.nit:449,2--470,4
redef fun rendering do end
src/doc/static/static_html.nit:269,2--27
redef fun rendering do
addn """
<div id='{{{id}}}' class='card'>
<div class='card-left text-center'>
{{{mentity.html_icon.write_to_string}}}
</div>
<div class='card-body'>
<h5 class='card-heading'>
{{{mentity.html_declaration.write_to_string}}}
</h5>
<p><small>{{{mentity.html_namespace.write_to_string}}}</small></p>"""
var mdoc = mentity.mdoc_or_fallback
if mdoc != null then
if full_doc then
addn mdoc.html_documentation
else
addn mdoc.html_synopsis
end
end
addn """
</div>
</div>"""
end
src/doc/static/static_cards.nit:192,2--214,4
redef fun rendering do
if not no_title then
addn "<h4>Summary</h4>"
end
addn "<div class='summary'>"
addn " <ul class='list-unstyled'>"
var sections = new Array[CardSection]
for card in cards do
if card isa CardSection then
while sections.not_empty and sections.last.level >= card.level do
sections.pop
end
sections.add card
end
var level = if sections.is_empty then 1 else sections.last.level
if not card isa CardSection then level += 1
addn "<li><a href='#{card.id}'><h{level}>{card.title}</h{level}></a></li>"
end
addn " </ul>"
addn "</div>"
end
src/doc/static/static_cards.nit:123,2--143,4
redef fun rendering do
var ancestors = self.ancestors
var descendants = self.descendants
if ancestors == null and parents == null and
children == null and descendants == null then return
addn "<div id='{id}' class='card'>"
addn " <div class='card-body'>"
if ancestors != null and ancestors.length <= 10 then
render_list("Ancestors", ancestors)
else
render_list("Parents", parents)
end
if descendants != null and descendants.length <= 10 then
render_list("Descendants", descendants)
else
render_list("Children", children)
end
addn " </div>"
addn "</div>"
end
src/doc/static/static_cards.nit:255,2--275,4
redef fun rendering do
if cards.is_empty then return
addn "<div id='{id}'>"
for card in cards do
addn card
if card == cards.last then break
addn "<h4 class='text-muted text-center'>"
addn " <span class='glyphicon glyphicon-chevron-up'></span>"
addn "</h4>"
end
addn "</div>"
end
src/doc/static/static_cards.nit:309,2--321,4
redef fun rendering do
addn "<div id='{id}' class='card'>"
addn " <div class='card-body'>"
if node != null then
addn "<pre>"
render_code
addn "</pre>"
end
addn "<span class='text-muted'>{mentity.location}</span>"
addn " </div>"
addn "</div>"
end
src/doc/static/static_cards.nit:398,2--411,4
redef fun rendering do
addn "<div id='{id}' class='container-fluid'>"
for key, value in catalog.catalog_stats.to_map do
addn "<span class='text-muted small'>"
addn " <strong>{value}</strong> <span>{key}</span> "
addn "</span>"
end
addn "</div>"
addn "<hr/>"
end
src/doc/static/static_cards.nit:463,2--472,4
redef fun rendering do
var tags = catalog.tag2proj.keys.to_a
if tags.is_empty then return
tags_sorter.sort(tags)
addn "<h2 id='{id}'>Tags</h2>"
addn "<div class='container-fluid'>"
for tag in tags do
addn "<div class='col-xs-6 col-sm-3 col-md-2'>"
addn " <span class='badge'>{catalog.tag2proj[tag].length}</span>"
addn " <a href='tag_{tag.to_cmangle}.html'>{tag}</a>"
addn "</div>"
end
addn "</div>"
addn "<hr/>"
end
src/doc/static/static_cards.nit:485,2--500,4
redef fun rendering do
for maintainer in metadata.maintainers do
addn """
<p class='lead'>
{{{maintainer.to_html}}}
</p>"""
end
var license = metadata.license
if license != null then
addn """
<span class='text-muted'>
<a href='http://opensource.org/licenses/{{{license}}}'>{{{license}}}</a>
license
</span>"""
end
var homepage = metadata.homepage
var browse = metadata.browse
var issues = metadata.issues
if homepage != null or browse != null or issues != null then
addn """
<h4>Links</h4>
<ul class='list-unstyled'>"""
if homepage != null then addn "<li><a href='{homepage}'>Homepage</a></li>"
if browse != null then addn "<li><a href='{browse}'>Source Code</a></li>"
if issues != null then addn "<li><a href='{issues}'>Issues</a></li>"
addn "</ul>"
end
var git = metadata.git
var last_date = metadata.last_date
var first_date = metadata.first_date
if git != null then
addn """
<h4>Git</h4>
<ul class='list-unstyled'>
<li><a href='{{{git}}}'>{{{git}}}</a></li>
</ul>
<span class='text-muted'><b>{{{stats.commits}}}</b> commits</span>
<br>"""
if last_date != null then
addn """<b class=text-muted>Last:</b> {{{last_date}}}<br>"""
end
if first_date != null then
addn """<b class=text-muted>First:</b> {{{first_date}}}"""
end
end
addn """
<h4>Quality</h4>
<ul class='list-unstyled'>
<li>{{{stats.documentation_score}}}% documented</li>
</ul>"""
if metadata.tags.not_empty then
addn "<h4>Tags</h4>"
for tag in metadata.tags do
addn " <a href='tag_{tag.to_cmangle}.html'>{tag}</a>"
if tag != metadata.tags.last then add ", "
end
end
if deps.not_empty then
addn "<h4>Dependencies</h4>"
for dep in deps do
add dep.html_link
if dep != deps.last then add ", "
end
end
if clients.not_empty then
addn "<h4>Clients</h4>"
for client in clients do
add client.html_link
if client != clients.last then add ", "
end
end
if metadata.contributors.not_empty then
addn """
<h4>Contributors</h4>
<ul class='list-unstyled'>"""
for contrib in metadata.contributors do
addn """<li>{{{contrib.to_html}}}</li>"""
end
addn "</ul>"
end
addn """
<h4>Stats</h4>
<ul class='list-unstyled'>
<li>{{{stats.mmodules}}} modules</li>
<li>{{{stats.mclasses}}} classes</li>
<li>{{{stats.mmethods}}} methods</li>
<li>{{{stats.loc}}} loc</li>
</ul>"""
end
src/doc/static/static_cards.nit:578,2--674,4
redef fun rendering do
addn "<nav class='navbar navbar-default navbar-fixed-top'>"
addn " <div class='container-fluid'>"
addn " <div class='navbar-header'>"
add " <button type='button' class='navbar-toggle' "
addn " data-toggle='collapse' data-target='#topmenu-collapse'>"
addn " <span class='sr-only'>Toggle menu</span>"
addn " <span class='icon-bar'></span>"
addn " <span class='icon-bar'></span>"
addn " <span class='icon-bar'></span>"
addn " </button>"
var brand = self.brand
if brand != null then
add "<span class='navbar-brand'>"
add brand
add "</span>"
end
addn " </div>"
addn " <div class='collapse navbar-collapse' id='topmenu-collapse'>"
addn " <ul class='nav navbar-nav'>"
for item in items do
if item == active_item then item.css_classes.add "active"
add item.write_to_string
end
addn " </ul>"
addn " <div id='search-placeholder'>"
addn " </div>"
addn " </div>"
addn " </div>"
addn "</nav>"
end
src/doc/static/static_html.nit:286,2--316,4
redef fun rendering do
addn "<h4>Summary</h4>"
addn "<div class='summary'>"
addn " <ul class='list-unstyled'>"
for id, headline in headlines do
var level = headline.level
var title = md_processor.process(headline.title)
addn "<li><a href='#{id}'><h{level}>{title}</h{level}></a></li>"
end
addn " </ul>"
addn "</div>"
end
src/doc/static/static_cards.nit:160,2--171,4
redef fun rendering do
var url = self.url
var cin = if is_active then "in" else ""
var active = if is_active then "active" else ""
addn """
<div class='card {{{active}}}' id='{{{id}}}'>
<div class='card-body'>
<h5>
{{{mentity.html_icon.write_to_string}}}
{{{mentity.html_namespace.write_to_string}}}"""
if node != null then
addn """
<div class='btn-bar'>
<button class='btn btn-link' data-toggle='collapse'
data-target='#{{{mentity.html_id}}}'>
<span class='glyphicon glyphicon-console' title='Show code' />
</button>
</div>"""
else if url != null then
addn """
<div class='btn-bar'>
<a class='btn btn-link' href='{{{url}}}'>
<span class='glyphicon glyphicon-console' title='Show code' />
</a>
</div>"""
var mdoc = mentity.mdoc
if mdoc != null then
addn "<br/><br/>"
addn mdoc.html_documentation
end
end
addn "</h5>"
if node != null then
addn """
<div id='{{{mentity.html_id}}}' class='collapse {{{cin}}}'>
<pre>"""
render_code
addn """</pre>
<span class='text-muted'>{{{mentity.location.to_s}}}</span>
</div>"""
end
addn """
</div>
</div>"""
end
src/doc/static/static_cards.nit:339,2--384,4
redef fun rendering do
var mpackage = self.mentity
if not mpackage isa MPackage then return
addn """
<div id='{{{id}}}' class='card'>
<div class='card-left text-center'>{{{mpackage.html_icon.write_to_string}}}</div>
<div class='card-body' style='width: 75%'>
<h5 class='card-heading'>
{{{mentity.html_declaration.write_to_string}}}
<small> """
for tag in mpackage.metadata.tags do
add "<span>"
add "<a href='tag_{tag.to_cmangle}.html' class='text-muted'>{tag}</a>"
if tag != mpackage.metadata.tags.last then addn ", "
add "</span>"
end
addn """</small>
</h5>"""
var mdoc = mentity.mdoc_or_fallback
if mdoc != null then
if full_doc then
addn mdoc.html_documentation
else
addn mdoc.html_synopsis
end
end
addn " </div>"
addn " <div class='card-right' style='width: 25%'>"
for maintainer in mpackage.metadata.maintainers do
addn maintainer.to_html
end
addn " <br>"
var license = mpackage.metadata.license
if license != null then
addn """
<span class='text-muted'>
<a href='http://opensource.org/licenses/{{{license}}}' class='text-muted'>
{{{license}}}
</a>
</span>"""
end
addn " </div>"
addn "</div>"
end
src/doc/static/static_cards.nit:511,2--555,4