Create a new toc list item based on section title.

@param headerBlock the {@link HeaderBlock}.
@return the new list item block.
967525
private ListItemBlock createTocEntry(HeaderBlock headerBlock, String documentReference)
    {
        // Create the link to target the header anchor
        DocumentResourceReference reference = new DocumentResourceReference(documentReference);
        reference.setAnchor(headerBlock.getId());
        LinkBlock linkBlock = new LinkBlock(this.tocBlockFilter.generateLabel(headerBlock), reference, false);

        return new ListItemBlock(Collections.singletonList(linkBlock));
    }
1164160
public static <S, L> Collection<S> getStatesInBlock(Block<S, L> block) {
        return new OriginalStateCollection<>(block.getStates());
    }
597514
protected function AddListLink($block)
	{
		$para = new XmlParagraphCollection();
		$this->_mainBlock->addXmlnukeObject($para);
		$this->url->addParam("action", ModuleAction::Listing);
		$link = new XmlAnchorCollection($this->url->getUrl(), "");
		$link->addXmlnukeObject(new XmlnukeText($this->myWords->Value("LINK_LISTROLES")));
		$para->addXmlnukeObject($link);
	}
116905
@Override
  public void addBlock(BlockInfo newblock) {
    if (this.blocks == null) {
      this.blocks = new BlockInfo[1];
      this.blocks[0] = newblock;
    } else {
      int size = this.blocks.length;
      BlockInfo[] newlist = new BlockInfo[size + 1];
      System.arraycopy(this.blocks, 0, newlist, 0, size);
      newlist[size] = newblock;
      this.blocks = newlist;
    }
  }
108920
private DataBlock getWriteDataBlock() throws IOException {
        if (writableBlocks.size() != 0) {
            return writableBlocks.get(0);
        }

        lock.lock();
        try {
            if (writableBlocks.size() != 0) {
                return writableBlocks.get(0);
            }
            DataBlock dataBlock = new DataBlock(storeConfig);
            NAME_BLOCK_MAP.put(dataBlock.getFileId(), dataBlock);
            writableBlocks.add(dataBlock);
            return dataBlock;
        } finally {
            lock.unlock();
        }
    }
1229337
public Javadoc addBlockTag(String tagName, String content) {
        return addBlockTag(new JavadocBlockTag(tagName, content));
    }
564395
public void setHeader(java.util.Collection<String> header) {
        if (header == null) {
            this.header = null;
            return;
        }

        this.header = new java.util.ArrayList<String>(header);
    }
702444
def create_header_from_parent(self,
                                  parent_header: BlockHeader,
                                  **header_params: HeaderParams) -> BlockHeader:
        
        return self.get_vm_class_for_block_number(
            block_number=parent_header.block_number + 1,
        ).create_header_from_parent(parent_header, **header_params)
846966
function(blocks) {
  var blockarr = blocks;
  if (!(blockarr instanceof Array)) {
    blockarr = [blockarr];
  }
  return {format: 'section', blocks: blockarr};
}
794114
private synchronized COSDataBlocks.DataBlock createBlockIfNeeded() throws IOException {
    if (activeBlock == null) {
      blockCount++;
      if (blockCount >= COSConstants.MAX_MULTIPART_COUNT) {
        LOG.error("Number of partitions in stream exceeds limit for S3: "
            + COSConstants.MAX_MULTIPART_COUNT
            + " write may fail.");
      }
      activeBlock = blockFactory.create(key, blockCount, blockSize);
    }
    return activeBlock;
  }
131980
private void addBlock(List<GenericCriteria> list, byte[] block, TestOperator operator)
   {
      GenericCriteria result = new GenericCriteria(m_properties);
      result.setOperator(operator);
      list.add(result);
      processBlock(result.getCriteriaList(), getChildBlock(block));
      processBlock(list, getListNextBlock(block));
   }
330515
function createCell(opts: Options, nodes?: Node[]): Block {
    return Block.create({
        type: opts.typeCell,
        nodes: nodes || [createEmptyContent(opts)]
    });
}
309339
function() {
    this.setColour(Blockly.Blocks.lists.HUE);
    this.appendDummyInput()
        .appendField(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE);
    this.setPreviousStatement(true);
    this.setNextStatement(true);
    this.setTooltip(Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP);
    this.contextMenu = false;
  }
1257222
private void setHeaderList(Map<String, List<String>> headers, String name, String value) {

        List<String> values = new ArrayList<String>();
        values.add(SET_HEADER + value);
        headers.put(name, values);
    }
1026143
public Content getPackageSerializedHeader() {
        HtmlTree li = new HtmlTree(HtmlTag.LI);
        li.addStyle(HtmlStyle.blockList);
        return li;
    }
753398
public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
        blockRoot.removeFromBlockList();

        blockRoot.setNextElement(next);
        if (getNextElement() != null) {
            next.setPrevElement(blockRoot);
        }
        blockRoot.setPrevElement(this);
        next = blockRoot;
    }
1244424
def toc(self):
        
        from mistletoe.block_token import List
        def get_indent(level):
            if self.omit_title:
                level -= 1
            return ' ' * 4 * (level - 1)

        def build_list_item(heading):
            level, content = heading
            template = '{indent}- {content}\n'
            return template.format(indent=get_indent(level), content=content)

        return List([build_list_item(heading) for heading in self._headings])