Insert custom text inside the note zone.
173187
protected void insertText(Element e, String text) {
        $(e).materialnote("insertText", SafeHtmlUtils.fromString(text).asString());
    }
20771
private void pushText() {
    if (buf.length() > 0) {
      nodes.add(new NumberPattern.Text(buf.toString()));
      buf.setLength(0);
    }
  }
1130412
def add_letter(self, letter):
        """"""
        assert isinstance(letter, str)
        assert len(letter) == 1

        self.text = self.text[:self.cursor] + letter + self.text[self.cursor:]
        self.cursor += 1
471603
private void addToMusic(MusicElement me) {
		if (me != null) {
			if (me instanceof DecorableElement)
				applySymbolsAndAnnotations((DecorableElement) me);
			if (!(me instanceof NotesSeparator)
					&& !(me instanceof Spacer)) {
				m_graceNotes.clear();
				m_graceNotesType = GracingType.APPOGGIATURA;
				//TODO attach graces to last parsed note ?
			}
			if ((m_tupletNumberOfNotes != -1)
				&& (me instanceof NoteAbstract)) {
				//we are filling a tuplet
				m_tupletNotes.add(me);
				if (m_tupletNotes.size() == m_tupletNumberOfNotes)
					closeTuplet();
			}
			m_music.getVoice(m_currentVoice).addElement(me);
		}
	}
919132
function createMarkdownSlide( content, options ) {

		options = getSlidifyOptions( options );

		var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) );

		if( notesMatch.length === 2 ) {
			content = notesMatch[0] + '<aside class="notes">' + marked(notesMatch[1].trim()) + '</aside>';
		}

		// prevent script end tags in the content from interfering
		// with parsing
		content = content.replace( /<\/script>/g, SCRIPT_END_PLACEHOLDER );

		return '<script type="text/template">' + content + '</script>';

	}
314894
private void insertSpan(TokenImageSpan tokenSpan) {
        CharSequence ssb = tokenizer.wrapTokenValue(tokenToString(tokenSpan.token));

        Editable editable = getText();
        if (editable == null) return;

        // If we haven't hidden any objects yet, we can try adding it
        if (hiddenContent == null) {
            internalEditInProgress = true;
            int offset = editable.length();
            //There might be a hint visible...
            if (hintVisible) {
                //...so we need to put the object in in front of the hint
                offset = prefix.length();
            } else {
                Range currentRange = getCurrentCandidateTokenRange();
                if (currentRange.length() > 0) {
                    // The user has entered some text that has not yet been tokenized.
                    // Find the beginning of this text and insert the new token there.
                    offset = currentRange.start;
                }
            }
            editable.insert(offset, ssb);
            editable.insert(offset  + ssb.length(), " ");
            editable.setSpan(tokenSpan, offset, offset + ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            internalEditInProgress = false;
        } else {
            CharSequence tokenText = tokenizer.wrapTokenValue(tokenToString(tokenSpan.getToken()));
            int start = hiddenContent.length();
            hiddenContent.append(tokenText);
            hiddenContent.append(" ");
            hiddenContent.setSpan(tokenSpan, start, start + tokenText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            updateCountSpan();
        }
    }
1359277
def _write_section(self, fp, section_name, section_items, delimiter):
        """"""
        fp.write("[{0}]\n".format(section_name))
        for key, value in section_items:
            value = self._interpolation.before_write(self, section_name, key,
                                                     value)
            if value is not None or not self._allow_no_value:
                value = delimiter + str(value).replace('\n', '\n\t')
            else:
                value = ""
            fp.write("{0}{1}\n".format(key, value))
        fp.write("\n")
353290
def fill(self, text=""):
        ""
        self.f.write(self.line_marker + "    " * self._indent + text)
        self.line_marker = "\n"
1149377
def insert_styles
        #TODO More customizable(reset.css, from file etc.)
        if @@lock_top_right
          extra_styles = <<-STYLES
            #footnotes_debug {position: fixed; top: 0px; right: 0px; width: 100%; z-index: 10000; margin-top: 0;}
            #footnotes_debug #toggle_footnotes {position: absolute; right: 0; top: 0; background: #fff; border: 1px solid #ccc; color: #9b1b1b; font-size: 20px; text-align: center; padding: 8px; opacity: 0.9;}
            #footnotes_debug #toggle_footnotes:hover {opacity: 1;}
            #footnotes_debug #all_footnotes {display: none; padding: 15px; background: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.4);}
            #footnotes_debug fieldset > div {max-height: 500px; overflow: scroll;}
          STYLES
        else
          extra_styles = <<-STYLES
            #footnotes_debug #toggle_footnotes {display: none;}
          STYLES
        end
        insert_text :before, /<\/head>/i, <<-HTML
        <!-- Footnotes Style -->
        <style type="text/css">
          #footnotes_debug {font-size: #{@@font_size}; font-family: Consolas, monaco, monospace; font-weight: normal; margin: 2em 0 1em 0; text-align: center; color: #444; line-height: 16px; background: #fff;}
          #footnotes_debug th, #footnotes_debug td {color: #444; line-height: 18px;}
          #footnotes_debug a {color: #9b1b1b; font-weight: inherit; text-decoration: none; line-height: 18px;}
          #footnotes_debug table {text-align: left; width: 100%;}
          #footnotes_debug table td {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table td strong {color: #9b1b1b;}
          #footnotes_debug table th {padding: 5px; border-bottom: 1px solid #ccc;}
          #footnotes_debug table tr:nth-child(2n) td {background: #f5f5f5;}
          #footnotes_debug table tr:nth-child(2n + 1) td {background: #fff;}
          #footnotes_debug tbody {text-align: left;}
          #footnotes_debug .name_values td {vertical-align: top;}
          #footnotes_debug legend {background-color: #fff;}
          #footnotes_debug fieldset {text-align: left; border: 1px dashed #aaa; padding: 0.5em 1em 1em 1em; margin: 1em 2em; color: #444; background-color: #FFF;}
          #{extra_styles}
          /* Aditional Stylesheets */
          #{@notes.map(&:stylesheet).compact.join("\n")}
        </style>
        <!-- End Footnotes Style -->
        HTML
      end
832689
def append_notes(self, notes, root, scale=0):
        
        for note in notes:
            self.append_note(note, root, scale)
1080287
def _fill_text(self, text, width, indent):
        
        parts = text.split('\n\n')
        for i, part in enumerate(parts):
            # Check to see if it's a bulleted list--if so, then fill each line
            if part.startswith('* '):
                subparts = part.split('\n')
                for j, subpart in enumerate(subparts):
                    subparts[j] = super(WrappedTextHelpFormatter, self)._fill_text(
                        subpart, width, indent
                    )
                parts[i] = '\n'.join(subparts)
            else:
                parts[i] = super(WrappedTextHelpFormatter, self)._fill_text(part, width, indent)

        return '\n\n'.join(parts)
1185114
def add_note(path, filename="note.txt"):
    
    path = os.path.expanduser(path)
    assert os.path.isdir(path), "{} is not a valid directory.".format(path)

    filepath = os.path.join(path, filename)
    exists = os.path.isfile(filepath)

    try:
        subprocess.call([EDITOR, filepath])
    except Exception as exc:
        logger.error("Editing note failed!")
        raise exc
    if exists:
        print("Note updated at:", filepath)
    else:
        print("Note created at:", filepath)
855491
def append(self, text):
        
        cursor = QTextCursor(self._doc)
        cursor.movePosition(QTextCursor.End)
        cursor.insertBlock()
        cursor.insertText(text)
926271
def insert_text(self, s, from_undo=False):
        """"""
        return super().insert_text(
            ''.join(c for c in s if c in '0123456789'),
            from_undo
        )
1298753
def _insertFont(self, fontname, bfname, fontfile, fontbuffer, set_simple, idx, wmode, serif, encoding, ordering):
        """"""
        return _fitz.Page__insertFont(self, fontname, bfname, fontfile, fontbuffer, set_simple, idx, wmode, serif, encoding, ordering)
132563
def fill_notebook(work_notebook, script_blocks):
    

    for blabel, bcontent, lineno in script_blocks:
        if blabel == 'code':
            add_code_cell(work_notebook, bcontent)
        else:
            add_markdown_cell(work_notebook, bcontent + '\n')
1339271
def indent (text, indent_string="  "):
    """"""
    lines = str(text).splitlines()
    return os.linesep.join("%s%s" % (indent_string, x) for x in lines)