Used to generate page hash tag or HTML attribute. by getPageName and getPageHash. Does it by joining page and arguments using the given separator.
3722
function (separator, page, args) {

        // By default, we return page name without arguments.
        var ret = page;
        if (typeof args !== 'undefined') {
            if (args && args.length) {
                // Some arguments have been provided, add them.
                if (args.length !== 0) {
                    ret = page + separator + args.join(separator);
                }
            } else {
                // Argument isn't an array, add it.
                ret = page + separator + args;
            }
        }
        return ret;
    }
428328
def url_for(page)
      page_one = page == 1
      unless @url_string and !page_one
        @url_params = {}
        # page links should preserve GET parameters
        stringified_merge @url_params, @template.params if @template.request.get?
        stringified_merge @url_params, @options[:params] if @options[:params]
        
        if complex = param_name.index(/[^\w-]/)
          page_param = (defined?(CGIMethods) ? CGIMethods : ActionController::AbstractRequest).
            parse_query_parameters("#{param_name}=#{page}")
          
          stringified_merge @url_params, page_param
        else
          @url_params[param_name] = page_one ? 1 : 2
        end

        url = @template.url_for(@url_params)
        return url if page_one
        
        if complex
          @url_string = url.sub(%r!((?:\?|&amp;)#{CGI.escape param_name}=)#{page}!, '\1@')
          return url
        else
          @url_string = url
          @url_params[param_name] = 3
          @template.url_for(@url_params).split(//).each_with_index do |char, i|
            if char == '3' and url[i, 1] == '2'
              @url_string[i] = '@'
              break
            end
          end
        end
      end
      # finally!
      @url_string.sub '@', page.to_s
    end
1364362
def prepare_param_tag(name_or_tag, &block) #  :yields: tag
        tag = case name_or_tag
          when WWW::Delicious::Tag
            name_or_tag
          else
            Tag.new(:name => name_or_tag.to_s)
          end

        yield(tag) if block_given?
        # TODO: validate tag with tag.validate!
        raise "Invalid `tag` value supplied" unless tag.api_valid?
        tag
      end
363701
def url(page)
      @base_url_params ||= begin
                             url_params = merge_get_params(default_url_params)
                             merge_optional_params(url_params)
                           end

      url_params = @base_url_params.dup
      add_current_page_param(url_params, page)

      # Add optional url_builder support
      (@options[:url_builder] || @template).url_for(url_params)
    end
507973
function generatePage(output, page) {
    var book = output.getBook();
    var engine = createTemplateEngine(output);

    return timing.measure(
        'page.generate',
        Promise(page)
        .then(function(resultPage) {
            var file = resultPage.getFile();
            var filePath = file.getPath();
            var parser = file.getParser();
            var context = JSONUtils.encodeOutputWithPage(output, resultPage);

            if (!parser) {
                return Promise.reject(error.FileNotParsableError({
                    filename: filePath
                }));
            }

            // Call hook "page:before"
            return callPageHook('page:before', output, resultPage)

            // Escape code blocks with raw tags
            .then(function(currentPage) {
                return parser.preparePage(currentPage.getContent());
            })

            // Render templating syntax
            .then(function(content) {
                var absoluteFilePath = path.join(book.getContentRoot(), filePath);
                return Templating.render(engine, absoluteFilePath, content, context);
            })

            .then(function(output) {
                var content = output.getContent();

                return parser.parsePage(content)
                .then(function(result) {
                    return output.setContent(result.content);
                });
            })

            // Post processing for templating syntax
            .then(function(output) {
                return Templating.postRender(engine, output);
            })

            // Return new page
            .then(function(content) {
                return resultPage.set('content', content);
            })

            // Call final hook
            .then(function(currentPage) {
                return callPageHook('page', output, currentPage);
            });
        })
    );
}
998953
public String transform(String html, URL url, boolean setBaseTag) throws PageException {
	StringBuffer target = new StringBuffer();
	SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML);
	while (!cfml.isAfterLast()) {
	    if (cfml.forwardIfCurrent('<')) {
		target.append('<');
		try {
		    for (int i = 0; i < tags.length; i++) {
			if (cfml.forwardIfCurrent(tags[i].tag + " ")) {
			    target.append(tags[i].tag + " ");
			    transformTag(target, cfml, tags[i], url);
			}
		    }
		}
		catch (MalformedURLException me) {
		    throw Caster.toPageException(me);
		}
	    }
	    else {
		target.append(cfml.getCurrent());
		cfml.next();
	    }

	}
	if (!setBaseTag) return target.toString();

	html = target.toString();
	String prefix = "", postfix = "";
	int index = StringUtil.indexOfIgnoreCase(html, "</head>");
	if (index == -1) {
	    prefix = "<head>";
	    postfix = "</head>";
	    index = StringUtil.indexOfIgnoreCase(html, "</html>");
	}

	if (index != -1) {
	    StringBuffer sb = new StringBuffer();
	    sb.append(html.substring(0, index));
	    String port = url.getPort() == -1 ? "" : ":" + url.getPort();
	    sb.append(prefix + "<base href=\"" + (url.getProtocol() + "://" + url.getHost() + port) + "\">" + postfix);
	    sb.append(html.substring(index));
	    html = sb.toString();

	}
	return html;
    }
1239800
public Set<String> getFieldParametersOnPage(Integer pageNumber) {
    Set<String> fieldParameters = parameterPageMap.get(pageNumber);
    if (fieldParameters == null) {
      fieldParameters = new HashSet<String>();
    }
    return fieldParameters;
  }
922668
def all
      attribute_maps = [] # [{...}, {...}]
      @pages = CEO::Paginator.new(
        @model,
        current_page: current_page,
        per_page: @options.fetch(:per_page, 20)
      )

      self.total_pages = @pages.total_pages

      @pages.each do |thing|
        attr_object = {}

        # TODO: Make all of this into a method.
        # map first-level values to a hash
        keys.each do |key|
          attr_object[self.class.acronymize(key)] = thing[key.to_s]
        end

        # map nested values to a hash
        @queries.each do |query|
          attr_object.merge! query_eval(thing, query)
        end
        attribute_maps << attr_object
      end
      attribute_maps
    end
395432
def page_header *args, &block
      if block_given?
        size = (1..6) === args.first ? args.first : 1
        content_tag :div, :class => "page-header" do
          content_tag "h#{size}" do
            capture(&block)
          end
        end
      else
        title = args.first
        size = (1..6) === args.second ? args.second : 1
        content_tag :div, content_tag("h#{size}", title), :class => "page-header"
      end
    end
1048961
public static String parsedPageToHtml( ParsedPage pp ){
		StringBuilder result = new StringBuilder();
		result.append(getHtmlHeader());

		if( pp != null ) {
    		//Title
    		result.append(
    			"<table class=\"ParsedPage\">\n"+
    			"<tr><th class=\"ParsedPage\">ParsedPage: \n" +
    			pp.getName()+
    			"</th></tr>\n");

//    		if( pp.aboutArticle()!=null ){
//    			result.append("<tr><td class=\"ParsedPage\">\n");
//    			result.append("About Article:" + contentElementToHtml( pp.aboutArticle() ));
//    			result.append("</td></tr>\n");
//    		}

    		//Sections
    		result.append(
    			"<tr><td class=\"ParsedPage\">\n"		);
    		for( Section s: pp.getSections() ) {
				result.append( sectionToHtml( s ));
			}
    		result.append(
    			"</td></tr>\n");

    		//Categories
    		if( pp.getCategoryElement()!= null ){
    			result.append("<tr><td class=\"ParsedPage\">\n");
    			result.append("Categories:\n"  + contentElementToHtml( pp.getCategoryElement() ));
    			result.append("</td></tr>\n");
    		}

    		//Languages
    		if( pp.getLanguagesElement()!= null ){
    			result.append("<tr><td class=\"ParsedPage\">\n");
    			result.append("Languages:\n"  + contentElementToHtml( pp.getLanguagesElement() ));
    			result.append("</td></tr>\n");
    		}

    		//Finalize
    		result.append("</table>\n");
        }

		result.append(getHtmlFooter());

		return result.toString();
	}
630211
def render_tag(name, attributes = {}, &block)
      if name =~ /^(.+?):(.+)$/
        render_tag($1) { render_tag($2, attributes, &block) }
      else
        tag_definition_block = @definitions[qualified_tag_name(name.to_s)]
        if tag_definition_block
          stack(name, attributes, block) do |tag|
            tag_definition_block.call(tag).to_s
          end
        else
          tag_missing(name, attributes, &block)
        end
      end
    end
1293378
protected String getOCRText(String filename, int pageNum) {
        if (filename != null && !filename.isEmpty()) {
            api.TessBaseAPISetInputName(handle, filename);
        }

        Pointer utf8Text = renderedFormat == RenderedFormat.HOCR ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseAPIGetUTF8Text(handle);
        String str = utf8Text.getString(0);
        api.TessDeleteText(utf8Text);
        return str;
    }
1281769
private function generateTagAttributes(): string
    {
        // When no attributes present, return empty string
        if (count($this->getAttributes()) === 0) {
            return '';
        }

        // Collect the attributes
        $renderedAttributes = [];
        foreach ($this->getAttributes() as $attribute => $value) {
            // Attributes can have a value or not, it just present (i.e. checked)
            $renderedAttributes[] = $this->generateAttribute($attribute, $value);
        }

        // Join the attributes with a space
        return implode(' ', $renderedAttributes);
    }
1342537
def to_a
      hash = {}
      @to_a ||=
        elements_with_tags.map.with_index do |(el, tag_name), idx|
          selector = @selector.dup
          selector[:index] = idx unless idx.zero?
          element = element_class.new(@query_scope, selector)
          if [HTMLElement, Input].include? element.class
            construct_subtype(element, hash, tag_name).tap { |e| e.cache = el }
          else
            element.tap { |e| e.cache = el }
          end
        end
    end
836581
function hashElement(wholeMatch,m1) {

        var blockText = m1;

        blockText = blockText.replace(/\n\n/g,"\n");
        blockText = blockText.replace(/^\n/,"");
        blockText = blockText.replace(/\n+$/g,"");
        blockText = "\n\n~K" + (htmlBlock.push(blockText)-1) + "K\n\n";

        return blockText;
    }
558708
def generate_page(page)
      output_filename = page.output_filename
      @log.success("creating #{output_filename}...")
      @log.debug("Rendering #{output_filename} from #{page.name}")
      file = File.join(@configuration.destination_path, output_filename)
      directory = File.dirname(file)

      unless File.directory?(directory)
        FileUtils.mkdir_p(directory)
      end

      File.write file, page.render

      FileUtils.touch file, mtime: page.mtime
      nil
    end
721759
function getPageName (pageDir, entry) {
  const page = '/' + relative(pageDir, entry)
  let base = page.split(extname(page)).join('')
  if (base[0] === '/') {
    base = base.substring(1)
  }
  if (base === 'index') {
    const dir = basename(dirname(page))
    return dir === '' ? 'index' : dir
  } else {
    return base
  }
}