Create an anchor with the title and the pubMedId
In the config file use:
fieldName="func(PUBMED_URL(title,pubMedID))"
165488
private String pubMedURL(int rowIndex){

        if(params.length != 2){
            throw new IllegalArgumentException("Wrong number of Parameters for limit string expression");
        }

        final RecordList.Record currentRecord = recordList.getRecords().get(rowIndex);
        final String title = currentRecord.getValueByFieldName(params[0]);
        String pubMedId = currentRecord.getValueByFieldName(params[1]);

        if (pubMedId.isEmpty()){
            return title;
        }

        String result = "<a href=" + "http://www.ncbi.nlm.nih.gov/pubmed/"+pubMedId+" target=_blank>"+title+"</a>";
        return result;
    }
657691
def get_abstract(pubmed_id, prepend_title=True):
    """"""
    article = get_article_xml(pubmed_id)
    if article is None:
        return None
    return _abstract_from_article_element(article, prepend_title)
1044435
def pubmed_url(args=sys.argv[1:], resolve_doi=True, out=sys.stdout):
    

    parser = argparse.ArgumentParser(
        description='Get a publication URL using a PubMed ID or PubMed URL')
    parser.add_argument('query', help='PubMed ID or PubMed URL')
    parser.add_argument(
        '-d', '--doi', action='store_false', help='get DOI URL')
    parser.add_argument(
        '-e', '--email', action='store', help='set user email', default='')

    args = parser.parse_args(args=args)

    lookup = PubMedLookup(args.query, args.email)
    publication = Publication(lookup, resolve_doi=args.doi)

    out.write(publication.url + '\n')
501808
function getDocsToPersist(docId, view, docIdsToChangesAndEmits) {
  var metaDocId = '_local/doc_' + docId;
  var defaultMetaDoc = {_id: metaDocId, keys: []};
  var docData = docIdsToChangesAndEmits[docId];
  var indexableKeysToKeyValues = docData.indexableKeysToKeyValues;
  var changes = docData.changes;

  function getMetaDoc() {
    if (isGenOne(changes)) {
      // generation 1, so we can safely assume initial state
      // for performance reasons (avoids unnecessary GETs)
      return Promise.resolve(defaultMetaDoc);
    }
    return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc));
  }

  function getKeyValueDocs(metaDoc) {
    if (!metaDoc.keys.length) {
      // no keys, no need for a lookup
      return Promise.resolve({rows: []});
    }
    return view.db.allDocs({
      keys: metaDoc.keys,
      include_docs: true
    });
  }

  function processKvDocs(metaDoc, kvDocsRes) {
    var kvDocs = [];
    var oldKeysMap = {};

    for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) {
      var row = kvDocsRes.rows[i];
      var doc = row.doc;
      if (!doc) { // deleted
        continue;
      }
      kvDocs.push(doc);
      oldKeysMap[doc._id] = true;
      doc._deleted = !indexableKeysToKeyValues[doc._id];
      if (!doc._deleted) {
        var keyValue = indexableKeysToKeyValues[doc._id];
        if ('value' in keyValue) {
          doc.value = keyValue.value;
        }
      }
    }

    var newKeys = Object.keys(indexableKeysToKeyValues);
    newKeys.forEach(function (key) {
      if (!oldKeysMap[key]) {
        // new doc
        var kvDoc = {
          _id: key
        };
        var keyValue = indexableKeysToKeyValues[key];
        if ('value' in keyValue) {
          kvDoc.value = keyValue.value;
        }
        kvDocs.push(kvDoc);
      }
    });
    metaDoc.keys = uniq(newKeys.concat(metaDoc.keys));
    kvDocs.push(metaDoc);

    return kvDocs;
  }

  return getMetaDoc().then(function (metaDoc) {
    return getKeyValueDocs(metaDoc).then(function (kvDocsRes) {
      return processKvDocs(metaDoc, kvDocsRes);
    });
  });
}
316987
function (xrefs, server){
    this._is_a = 'amigo2.linker';

    // TODO:BUG: With the new dispatcher, relative URLs no longer work.

    this._xrefs = xrefs;

    // Easy app base.
    this.app_base = server.app_base;
    // Internal term matcher.
    this.term_regexp = null;
    var internal_regexp_str = server.term_regexp;
    if( internal_regexp_str ){
	this.term_regexp = new RegExp(internal_regexp_str);
    }

    // Categories for different special cases (internal links).
    this.ont_category = {
	'term': true,
	'ontology_class': true,
	'annotation_class': true,
	'annotation_class_closure': true,
	'annotation_class_list': true,
	// Noctua model stuff.
	'function_class': true,
	'function_class_closure': true,
	'process_class': true,
	'process_class_closure': true,
	'location_list': true,
	'location_list_closure': true
    };
    this.bio_category = {
        'gp': true,
	'gene_product': true,
	'bioentity': true
    };
    this.ref_category = {
	'reference': true
    };
    this.model_category = {
        'model': true
    };
    this.search_category = { // not including the trivial medial_search below
        'search': true,
	'live_search': true
    };
    this.search_modifier = {
	// Possibly "dynamic".
	'gene_product': '/bioentity',
	'bioentity': '/bioentity',
	'ontology': '/ontology',
	'reference': '/reference',
	'annotation': '/annotation',
	'model': '/model',
	'family': '/family',
	'lego_unit': '/lego_unit',
	'general': '/general'
    };
    this.other_interlinks = {
	'medial_search': '/amigo/medial_search',
	'landing': '/amigo/landing',
	'tools': '/amigo/software_list',
	'schema_details': '/amigo/schema_details',
	'load_details': '/amigo/load_details',
	'browse': '/amigo/browse',
	'goose': '/goose',
	'grebe': '/grebe',
	'gannet': '/gannet',
	'repl': '/repl'	
    };
}
111613
function Doc(text, file, line, options) {
  if (typeof text == 'object') {
    for ( var key in text) {
      this[key] = text[key];
    }
  } else {
    this.text = text;
    this.file = file;
    this.line = line;
  }
  this.options = options || {};
  this.scenarios = this.scenarios || [];
  this.requires = this.requires || [];
  this.param = this.param || [];
  this.properties = this.properties || [];
  this.methods = this.methods || [];
  this.events = this.events || [];
  this.links = this.links || [];
  this.anchors = this.anchors || [];
}
457423
def _attach_config(mfg_event, record):
  """"""
  if 'config' not in record.metadata:
    return
  attachment = mfg_event.attachment.add()
  attachment.name = 'config'
  attachment.value_binary = _convert_object_to_json(record.metadata['config'])
  attachment.type = test_runs_pb2.TEXT_UTF8
558440
function(docpad) {
    var config = docpad.config.plugins.lunr;
    if (typeof config === 'undefined' || typeof config.indexes === 'undefined') {
      console.log('LUNR: This plugin will not work until at least 1 index is defined in the Docpad configuration file.');
      return;
    }
    // default config to use
    var defaults = {
      indexFields: [
        { name: 'title', boost: 10 },
        { name: 'body', boost: 1 }
      ],
      // all fields that will be displayed in the search results
      contentFields: [
        { name: 'title' },
        { name: 'url' }
      ],
      resultsTemplate: function(context) {
        var post = context.post;
        return '<div><a href="' + post.url + '">' + post.title + '</a></div>';
      },
      noResultsMessage: 'Sorry, there are no results for that search.'
    };
    // set up the default options
    if (typeof config.indexes.default === 'undefined') {
      config.indexes.default = defaults;
    } else {
      for (var prop in defaults) {
        if (typeof config.indexes.default[prop] === 'undefined') {
          config.indexes.default[prop] = defaults[prop];
        }
      }
    }
    // now copy the default options onto any indexes with omitted options
    for (var index in config.indexes) {
      if (index == 'default') {
        continue;
      }
      for (var prop in config.indexes.default) {
        if (typeof config.indexes[index][prop] === 'undefined') {
          config.indexes[index][prop] = config.indexes.default[prop];
        }
      }
    }
    // we now have no use for the "default" index so delete it
    delete config.indexes.default;

    // give warning message if any collections are missing
    for (var index in config.indexes) {
      if (typeof config.indexes[index].collection === 'undefined') {
        console.log('LUNR: The "' + index + '" index will be ignored because a collection is not specified.');
      }
    }
    // save the base directory location
    config.baseLocation = docpad.config.outPath + '/lunr';
    // save some more values for later
    config.rootPath = docpad.config.rootPath;
    // now we loop through all the indexes
    for (var index in config.indexes) {
      // make sure its directory exists
      config.indexes[index].indexFilename = 'lunr-data-' +
        index.replace(/[^a-z0-9]/gi, '_').toLowerCase() + '.js';
      // create a Lunr index
      var idx = new lunr.Index;
      // add Lunr's stopword filter and stemmer
      var stopWordFilter = lunr.stopWordFilter;
      // add any stopwords
      if (typeof config.indexes[index].stopWords !== 'undefined') {
        for (var i in config.indexes[index].stopWords) {
          stopWordFilter.stopWords.add(config.indexes[index].stopWords[i]);
        }
      }
      idx.pipeline.add(stopWordFilter, lunr.stemmer);
      // set up the fields for the index
      for (var i in config.indexes[index].indexFields) {
        var boost = config.indexes[index].indexFields[i].boost || 1;
        var name = config.indexes[index].indexFields[i].name;
        idx.field(name, { 'boost': boost });
      }
      // the document unique identifier will always be cid
      idx.ref('cid');
      // store the index
      config.indexes[index].idx = idx;
      // prep object for storing all the content of the indexed items
      config.indexes[index].content = {};
      // make sure that there are no facet fields that are not present in
      // the content fields (since facet functionality is currently a
      // "poor-man's" version that happens outside of Lunr)
      if (typeof config.indexes[index].facetFields !== 'undefined') {
        for (var i in config.indexes[index].facetFields) {
          var facetInContent = false;
          var facetField = config.indexes[index].facetFields[i].name;
          for (var j in config.indexes[index].contentFields) {
            contentField = config.indexes[index].contentFields[j].name;
            if (contentField == facetField) {
              facetInContent = true;
              break;
            }
          }
          if (!facetInContent) {
            config.indexes[index].contentFields.push({ name: facetField });
          }
        }
      }
    }
    this.config = config;
  }
1196478
def get_field_link(context, field, obj=None):
    
    view = context['view']
    return view.lookup_field_link(context, field, obj)
672138
def anchor(parser, token):
    
    bits = [b for b in token.split_contents()]
    if len(bits) < 2:
        raise template.TemplateSyntaxError("anchor tag takes at least 1 argument.")

    title_is_var = False
    try:
        title = bits[2]
        if title[0] in ('"', "'"):
            if title[0] == title[-1]:
                title = title[1:-1]
            else:
                raise template.TemplateSyntaxError(
                    'anchor tag title must be a "string", _("trans string"), or variable'
                )
        elif title.startswith('_("') or title.startswith("_('"):
            title = _(title[3:-2])
        else:
            title_is_var = True
    except IndexError:
        title = bits[1].capitalize()

    return SortAnchorNode(bits[1].strip(), title.strip(), title_is_var)
592747
def add_field(self, name, default_value=None):
        """"""
        self._fields[name] = default_value

        def func(cluster):
            return self.get(name, cluster)

        setattr(self, name, func)
419496
def name_to_config(template):
    
    if objectstore.is_remote(template):
        with objectstore.open_file(template) as in_handle:
            config = yaml.safe_load(in_handle)
        with objectstore.open_file(template) as in_handle:
            txt_config = in_handle.read()
    elif os.path.isfile(template):
        if template.endswith(".csv"):
            raise ValueError("Expected YAML file for template and found CSV, are arguments switched? %s" % template)
        with open(template) as in_handle:
            txt_config = in_handle.read()
        with open(template) as in_handle:
            config = yaml.safe_load(in_handle)
    else:
        base_url = "https://raw.github.com/bcbio/bcbio-nextgen/master/config/templates/%s.yaml"
        try:
            with contextlib.closing(urllib.request.urlopen(base_url % template)) as in_handle:
                txt_config = in_handle.read().decode()
            with contextlib.closing(urllib.request.urlopen(base_url % template)) as in_handle:
                config = yaml.safe_load(in_handle)
        except (urllib.error.HTTPError, urllib.error.URLError):
            raise ValueError("Could not find template '%s' locally or in standard templates on GitHub"
                             % template)
    return config, txt_config
414138
def add_section(self, name=None, anchor=None, description='', comment='', helptext='', plot='', content='', autoformat=True, autoformat_type='markdown'):
        

        # Default anchor
        if anchor is None:
            if name is not None:
                nid = name.lower().strip().replace(' ','-')
                anchor = '{}-{}'.format(self.anchor, nid)
            else:
                sl = len(self.sections) + 1
                anchor = '{}-section-{}'.format(self.anchor, sl)

        # Skip if user has a config to remove this module section
        if anchor in config.remove_sections:
            logger.debug("Skipping section '{}' because specified in user config".format(anchor))
            return

        # Sanitise anchor ID and check for duplicates
        anchor = report.save_htmlid(anchor)

        # See if we have a user comment in the config
        if anchor in config.section_comments:
            comment = config.section_comments[anchor]

        # Format the content
        if autoformat:
            if len(description) > 0:
                description = textwrap.dedent(description)
                if autoformat_type == 'markdown':
                    description = markdown.markdown(description)
            if len(comment) > 0:
                comment = textwrap.dedent(comment)
                if autoformat_type == 'markdown':
                    comment = markdown.markdown(comment)
            if len(helptext) > 0:
                helptext = textwrap.dedent(helptext)
                if autoformat_type == 'markdown':
                    helptext = markdown.markdown(helptext)

        # Strip excess whitespace
        description = description.strip()
        comment = comment.strip()
        helptext = helptext.strip()

        self.sections.append({
            'name': name,
            'anchor': anchor,
            'description': description,
            'comment': comment,
            'helptext': helptext,
            'plot': plot,
            'content': content,
            'print_section': any([ n is not None and len(n) > 0 for n in [description, comment, helptext, plot, content] ])
        })
1329396
def apply_docstr(docstr_func):
    
    def docstr_applier(func):
        #docstr = meta_util_six.get_funcdoc(docstr_func)
        #meta_util_six.set_funcdoc(func, docstr)
        if isinstance(docstr_func, six.string_types):
            olddoc = meta_util_six.get_funcdoc(func)
            if olddoc is None:
                olddoc = ''
            newdoc = olddoc + docstr_func
            meta_util_six.set_funcdoc(func, newdoc)
            return func
        else:
            preserved_func = preserve_sig(func, docstr_func)
            return preserved_func
    return docstr_applier
657285
def text_anchor(anchor)
      Kernel.raise ArgumentError, "Unknown anchor constant: #{anchor}" unless ANCHOR_TYPE_NAMES.key?(anchor.to_i)
      primitive "text-anchor #{ANCHOR_TYPE_NAMES[anchor.to_i]}"
    end
1115177
def _docf(self, tag, val):
        
        if tag == 'type':
            fq_val = val
            if '.' not in val:
                fq_val = self.cur_namespace.name + '.' + fq_val
            return ':class:`{}.{}`'.format(self.args.types_package, fq_val)
        elif tag == 'route':
            if ':' in val:
                val, version = val.split(':', 1)
                version = int(version)
            else:
                version = 1
            if '.' in val:
                return ':meth:`{}`'.format(fmt_func(val, version=version))
            else:
                return ':meth:`{}_{}`'.format(
                    self.cur_namespace.name, fmt_func(val, version=version))
        elif tag == 'link':
            anchor, link = val.rsplit(' ', 1)
            return '`{} <{}>`_'.format(anchor, link)
        elif tag == 'val':
            if val == 'null':
                return 'None'
            elif val == 'true' or val == 'false':
                return '``{}``'.format(val.capitalize())
            else:
                return val
        elif tag == 'field':
            return '``{}``'.format(val)
        else:
            raise RuntimeError('Unknown doc ref tag %r' % tag)
121830
def add_url(self, url, description=None):
        
        url = {
            'value': url,
        }
        if description:
            url['description'] = description
        self._append_to('urls', url)